github.com/status-im/status-go@v1.1.0/protocol/internal/sqlite/migrations.go (about)

     1  // Code generated by go-bindata.
     2  // sources:
     3  // 000001_init.down.db.sql
     4  // 000001_init.up.db.sql
     5  // doc.go
     6  // DO NOT EDIT!
     7  
     8  package sqlite
     9  
    10  import (
    11  	"bytes"
    12  	"compress/gzip"
    13  	"fmt"
    14  	"io"
    15  	"io/ioutil"
    16  	"os"
    17  	"path/filepath"
    18  	"strings"
    19  	"time"
    20  )
    21  
    22  func bindataRead(data []byte, name string) ([]byte, error) {
    23  	gz, err := gzip.NewReader(bytes.NewBuffer(data))
    24  	if err != nil {
    25  		return nil, fmt.Errorf("Read %q: %v", name, err)
    26  	}
    27  
    28  	var buf bytes.Buffer
    29  	_, err = io.Copy(&buf, gz)
    30  	clErr := gz.Close()
    31  
    32  	if err != nil {
    33  		return nil, fmt.Errorf("Read %q: %v", name, err)
    34  	}
    35  	if clErr != nil {
    36  		return nil, err
    37  	}
    38  
    39  	return buf.Bytes(), nil
    40  }
    41  
    42  type asset struct {
    43  	bytes []byte
    44  	info  os.FileInfo
    45  }
    46  
    47  type bindataFileInfo struct {
    48  	name    string
    49  	size    int64
    50  	mode    os.FileMode
    51  	modTime time.Time
    52  }
    53  
    54  func (fi bindataFileInfo) Name() string {
    55  	return fi.name
    56  }
    57  func (fi bindataFileInfo) Size() int64 {
    58  	return fi.size
    59  }
    60  func (fi bindataFileInfo) Mode() os.FileMode {
    61  	return fi.mode
    62  }
    63  func (fi bindataFileInfo) ModTime() time.Time {
    64  	return fi.modTime
    65  }
    66  func (fi bindataFileInfo) IsDir() bool {
    67  	return false
    68  }
    69  func (fi bindataFileInfo) Sys() interface{} {
    70  	return nil
    71  }
    72  
    73  var __000001_initDownDbSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x2d\x4e\x2d\x8a\xcf\x4d\x2d\x2e\x4e\x4c\x4f\x2d\xb6\xe6\x42\x92\xc9\x4d\xcd\x4d\x4a\x2d\x2a\xce\xc8\x2c\x88\x2f\x2d\x48\x49\x2c\x41\x93\x4e\xce\x48\x2c\x89\x87\xaa\xb1\xe6\x02\x04\x00\x00\xff\xff\x69\x98\x5e\xa1\x52\x00\x00\x00")
    74  
    75  func _000001_initDownDbSqlBytes() ([]byte, error) {
    76  	return bindataRead(
    77  		__000001_initDownDbSql,
    78  		"000001_init.down.db.sql",
    79  	)
    80  }
    81  
    82  func _000001_initDownDbSql() (*asset, error) {
    83  	bytes, err := _000001_initDownDbSqlBytes()
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  
    88  	info := bindataFileInfo{name: "000001_init.down.db.sql", size: 82, mode: os.FileMode(420), modTime: time.Unix(1563274106, 0)}
    89  	a := &asset{bytes: bytes, info: info}
    90  	return a, nil
    91  }
    92  
    93  var __000001_initUpDbSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x52\xb1\x6e\xc2\x30\x14\xdc\xf3\x15\x6f\x24\x12\x43\xf7\x4e\x0e\xbc\x80\xd5\xd4\x6e\x1d\xa7\xc0\x14\x19\xe2\x82\x0b\x09\x11\x36\x52\xf9\xfb\xaa\x49\x8c\x02\x45\x15\xac\xef\xce\xe7\xbb\x7b\x6f\x24\x90\x48\x04\x49\xa2\x04\x81\xc6\xc0\xb8\x04\x9c\xd3\x54\xa6\x70\xb4\xfa\x90\x97\xda\x5a\xb5\xd6\x16\x06\x01\x00\x80\x29\x20\x4a\x78\x04\x19\xa3\xef\x19\x36\x6c\x96\x25\xc9\xb0\x01\x57\x1b\xe5\x72\x53\xc0\x07\x11\xa3\x29\x11\xd7\xe8\xbe\x72\xba\x72\xb9\x3b\xd5\xda\x53\x5a\xa4\xfb\xe3\x06\xe2\xf4\xb7\x03\x89\x73\xd9\x49\xec\xf6\xab\x2d\x44\x74\x42\x59\x37\x71\xa6\xd4\xd6\xa9\xb2\xbe\x98\xfa\xaf\xbc\xa1\x9e\x82\x37\x71\x29\x5c\x1f\x97\x3b\xb3\xca\xb7\xfa\xd4\xc4\x6b\x87\x9f\x3b\xb5\xb6\x40\x99\x3c\x07\x81\x31\xc6\x24\x4b\x24\x3c\x05\xe1\x73\x10\x74\xdd\x51\x36\xc6\xb9\x0f\x6f\x81\xb3\xcb\xe6\x06\x1d\xd2\x7b\x71\xab\xed\x52\x97\x4b\x7d\xb0\x1b\x53\xe7\xc7\xba\x50\xae\x5f\xb9\x2f\xf4\x4d\xd0\x57\x22\x16\xf0\x82\x8b\xab\x72\x0b\xe5\x54\xbb\x99\x47\x56\x12\x73\x81\x74\xc2\x1a\xbd\xb3\x4d\x10\x18\xa3\x40\x36\xc2\xb4\x79\x6e\x07\xa6\x08\x83\x10\x66\x54\x4e\x79\x26\x41\xf0\x19\x1d\xff\x9f\xa5\x91\xea\x02\x75\x29\xae\x1a\x7e\xc8\xa6\x2a\x4a\x53\x41\xc4\x79\x82\x84\xfd\x5d\x46\x4c\x92\x14\x5b\xe6\xd7\xde\x54\xba\xb8\x8b\x7a\x7f\xf6\x96\xdf\x5e\xbc\x67\x0e\x7b\x81\xc2\xdf\x63\xf8\x09\x00\x00\xff\xff\x66\xab\x2d\x2f\x48\x03\x00\x00")
    94  
    95  func _000001_initUpDbSqlBytes() ([]byte, error) {
    96  	return bindataRead(
    97  		__000001_initUpDbSql,
    98  		"000001_init.up.db.sql",
    99  	)
   100  }
   101  
   102  func _000001_initUpDbSql() (*asset, error) {
   103  	bytes, err := _000001_initUpDbSqlBytes()
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  
   108  	info := bindataFileInfo{name: "000001_init.up.db.sql", size: 840, mode: os.FileMode(420), modTime: time.Unix(1563274106, 0)}
   109  	a := &asset{bytes: bytes, info: info}
   110  	return a, nil
   111  }
   112  
   113  var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x8f\x3b\x72\xc3\x30\x0c\x44\x7b\x9d\x62\xc7\x8d\x9b\x88\x6c\x52\xa5\x4b\x99\x3e\x17\x80\x49\x88\xc4\x98\x1f\x85\x80\xfc\xb9\x7d\x46\x4e\x66\xe2\x2e\xed\x0e\xde\xe2\xad\xf7\xf8\xcc\xa2\x58\xa4\x30\x44\xd1\x38\xb0\x2a\x8d\x3b\x4e\x1c\x68\x53\xc6\x21\x89\xe5\xed\xe4\x42\xaf\x5e\x8d\x6c\xd3\x59\xaa\xaf\x92\x06\x19\xfb\xcb\xeb\x61\xf2\x1e\x81\xda\xd1\x90\xa9\xc5\xc2\x8f\x2e\x85\x1a\x0d\x93\x96\x70\x15\xcb\x20\xac\x83\x17\xb9\x39\xbc\x1b\x0a\x93\x1a\x2c\x93\x1d\x15\x96\x19\x81\x94\xf7\x9a\xa5\x0f\xa4\x3e\x9f\xa4\x45\x32\x72\x7b\xf4\xb1\x3c\x25\xbb\x61\xa0\x52\x38\x62\x19\xbd\x3e\x58\xa5\xca\x88\x32\x38\x58\x1f\xf7\x17\x90\x2a\x1b\x1a\x55\xd6\x9d\xcf\x74\x61\xb4\xfe\xfb\x1e\xd4\xe2\xff\x8b\x70\xed\xe3\xac\x20\x05\xdf\x56\x0e\xc6\xd1\x4d\xd3\x4a\xe1\x4c\x89\xf1\x73\x27\xbd\xe9\x34\x79\x9f\xfa\x5b\xe2\xc6\x3b\xf9\xec\x39\xaf\xe7\x04\xfd\x2a\x62\x8c\xb9\xc3\x39\xff\x87\xb9\xd4\xe1\xa6\xef\x00\x00\x00\xff\xff\xcd\x86\x58\x5c\x79\x01\x00\x00")
   114  
   115  func docGoBytes() ([]byte, error) {
   116  	return bindataRead(
   117  		_docGo,
   118  		"doc.go",
   119  	)
   120  }
   121  
   122  func docGo() (*asset, error) {
   123  	bytes, err := docGoBytes()
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  
   128  	info := bindataFileInfo{name: "doc.go", size: 377, mode: os.FileMode(420), modTime: time.Unix(1563274106, 0)}
   129  	a := &asset{bytes: bytes, info: info}
   130  	return a, nil
   131  }
   132  
   133  // Asset loads and returns the asset for the given name.
   134  // It returns an error if the asset could not be found or
   135  // could not be loaded.
   136  func Asset(name string) ([]byte, error) {
   137  	cannonicalName := strings.Replace(name, "\\", "/", -1)
   138  	if f, ok := _bindata[cannonicalName]; ok {
   139  		a, err := f()
   140  		if err != nil {
   141  			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
   142  		}
   143  		return a.bytes, nil
   144  	}
   145  	return nil, fmt.Errorf("Asset %s not found", name)
   146  }
   147  
   148  // MustAsset is like Asset but panics when Asset would return an error.
   149  // It simplifies safe initialization of global variables.
   150  func MustAsset(name string) []byte {
   151  	a, err := Asset(name)
   152  	if err != nil {
   153  		panic("asset: Asset(" + name + "): " + err.Error())
   154  	}
   155  
   156  	return a
   157  }
   158  
   159  // AssetInfo loads and returns the asset info for the given name.
   160  // It returns an error if the asset could not be found or
   161  // could not be loaded.
   162  func AssetInfo(name string) (os.FileInfo, error) {
   163  	cannonicalName := strings.Replace(name, "\\", "/", -1)
   164  	if f, ok := _bindata[cannonicalName]; ok {
   165  		a, err := f()
   166  		if err != nil {
   167  			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
   168  		}
   169  		return a.info, nil
   170  	}
   171  	return nil, fmt.Errorf("AssetInfo %s not found", name)
   172  }
   173  
   174  // AssetNames returns the names of the assets.
   175  func AssetNames() []string {
   176  	names := make([]string, 0, len(_bindata))
   177  	for name := range _bindata {
   178  		names = append(names, name)
   179  	}
   180  	return names
   181  }
   182  
   183  // _bindata is a table, holding each asset generator, mapped to its name.
   184  var _bindata = map[string]func() (*asset, error){
   185  	"000001_init.down.db.sql": _000001_initDownDbSql,
   186  	"000001_init.up.db.sql":   _000001_initUpDbSql,
   187  	"doc.go":                  docGo,
   188  }
   189  
   190  // AssetDir returns the file names below a certain
   191  // directory embedded in the file by go-bindata.
   192  // For example if you run go-bindata on data/... and data contains the
   193  // following hierarchy:
   194  //     data/
   195  //       foo.txt
   196  //       img/
   197  //         a.png
   198  //         b.png
   199  // then AssetDir("data") would return []string{"foo.txt", "img"}
   200  // AssetDir("data/img") would return []string{"a.png", "b.png"}
   201  // AssetDir("foo.txt") and AssetDir("notexist") would return an error
   202  // AssetDir("") will return []string{"data"}.
   203  func AssetDir(name string) ([]string, error) {
   204  	node := _bintree
   205  	if len(name) != 0 {
   206  		cannonicalName := strings.Replace(name, "\\", "/", -1)
   207  		pathList := strings.Split(cannonicalName, "/")
   208  		for _, p := range pathList {
   209  			node = node.Children[p]
   210  			if node == nil {
   211  				return nil, fmt.Errorf("Asset %s not found", name)
   212  			}
   213  		}
   214  	}
   215  	if node.Func != nil {
   216  		return nil, fmt.Errorf("Asset %s not found", name)
   217  	}
   218  	rv := make([]string, 0, len(node.Children))
   219  	for childName := range node.Children {
   220  		rv = append(rv, childName)
   221  	}
   222  	return rv, nil
   223  }
   224  
   225  type bintree struct {
   226  	Func     func() (*asset, error)
   227  	Children map[string]*bintree
   228  }
   229  
   230  var _bintree = &bintree{nil, map[string]*bintree{
   231  	"000001_init.down.db.sql": &bintree{_000001_initDownDbSql, map[string]*bintree{}},
   232  	"000001_init.up.db.sql":   &bintree{_000001_initUpDbSql, map[string]*bintree{}},
   233  	"doc.go":                  &bintree{docGo, map[string]*bintree{}},
   234  }}
   235  
   236  // RestoreAsset restores an asset under the given directory
   237  func RestoreAsset(dir, name string) error {
   238  	data, err := Asset(name)
   239  	if err != nil {
   240  		return err
   241  	}
   242  	info, err := AssetInfo(name)
   243  	if err != nil {
   244  		return err
   245  	}
   246  	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
   247  	if err != nil {
   248  		return err
   249  	}
   250  	err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
   251  	if err != nil {
   252  		return err
   253  	}
   254  	err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
   255  	if err != nil {
   256  		return err
   257  	}
   258  	return nil
   259  }
   260  
   261  // RestoreAssets restores an asset under the given directory recursively
   262  func RestoreAssets(dir, name string) error {
   263  	children, err := AssetDir(name)
   264  	// File
   265  	if err != nil {
   266  		return RestoreAsset(dir, name)
   267  	}
   268  	// Dir
   269  	for _, child := range children {
   270  		err = RestoreAssets(dir, filepath.Join(name, child))
   271  		if err != nil {
   272  			return err
   273  		}
   274  	}
   275  	return nil
   276  }
   277  
   278  func _filePath(dir, name string) string {
   279  	cannonicalName := strings.Replace(name, "\\", "/", -1)
   280  	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
   281  }