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

     1  // Code generated by go-bindata. DO NOT EDIT.
     2  // sources:
     3  // 1561059284_add_waku_keys.down.sql (22B)
     4  // 1561059284_add_waku_keys.up.sql (109B)
     5  // 1616691080_add_wakuV2_keys.down.sql (24B)
     6  // 1616691080_add_wakuV2_keys.up.sql (111B)
     7  // 1634723014_add_wakuV2_keys.up.sql (125B)
     8  // doc.go (393B)
     9  
    10  package sqlite
    11  
    12  import (
    13  	"bytes"
    14  	"compress/gzip"
    15  	"crypto/sha256"
    16  	"fmt"
    17  	"io"
    18  	"os"
    19  	"path/filepath"
    20  	"strings"
    21  	"time"
    22  )
    23  
    24  func bindataRead(data []byte, name string) ([]byte, error) {
    25  	gz, err := gzip.NewReader(bytes.NewBuffer(data))
    26  	if err != nil {
    27  		return nil, fmt.Errorf("read %q: %w", name, err)
    28  	}
    29  
    30  	var buf bytes.Buffer
    31  	_, err = io.Copy(&buf, gz)
    32  	clErr := gz.Close()
    33  
    34  	if err != nil {
    35  		return nil, fmt.Errorf("read %q: %w", name, err)
    36  	}
    37  	if clErr != nil {
    38  		return nil, err
    39  	}
    40  
    41  	return buf.Bytes(), nil
    42  }
    43  
    44  type asset struct {
    45  	bytes  []byte
    46  	info   os.FileInfo
    47  	digest [sha256.Size]byte
    48  }
    49  
    50  type bindataFileInfo struct {
    51  	name    string
    52  	size    int64
    53  	mode    os.FileMode
    54  	modTime time.Time
    55  }
    56  
    57  func (fi bindataFileInfo) Name() string {
    58  	return fi.name
    59  }
    60  func (fi bindataFileInfo) Size() int64 {
    61  	return fi.size
    62  }
    63  func (fi bindataFileInfo) Mode() os.FileMode {
    64  	return fi.mode
    65  }
    66  func (fi bindataFileInfo) ModTime() time.Time {
    67  	return fi.modTime
    68  }
    69  func (fi bindataFileInfo) IsDir() bool {
    70  	return false
    71  }
    72  func (fi bindataFileInfo) Sys() interface{} {
    73  	return nil
    74  }
    75  
    76  var __1561059284_add_waku_keysDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x4f\xcc\x2e\x8d\xcf\x4e\xad\x2c\xb6\xe6\x02\x04\x00\x00\xff\xff\x4f\x00\xe6\x8e\x16\x00\x00\x00")
    77  
    78  func _1561059284_add_waku_keysDownSqlBytes() ([]byte, error) {
    79  	return bindataRead(
    80  		__1561059284_add_waku_keysDownSql,
    81  		"1561059284_add_waku_keys.down.sql",
    82  	)
    83  }
    84  
    85  func _1561059284_add_waku_keysDownSql() (*asset, error) {
    86  	bytes, err := _1561059284_add_waku_keysDownSqlBytes()
    87  	if err != nil {
    88  		return nil, err
    89  	}
    90  
    91  	info := bindataFileInfo{name: "1561059284_add_waku_keys.down.sql", size: 22, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)}
    92  	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe5, 0x2a, 0x7e, 0x9, 0xa3, 0xdd, 0xc6, 0x3, 0xfa, 0xaa, 0x98, 0xa0, 0x26, 0x5e, 0x67, 0x43, 0xe6, 0x20, 0xfd, 0x10, 0xfd, 0x60, 0x89, 0x17, 0x13, 0x87, 0x1b, 0x44, 0x36, 0x79, 0xb6, 0x60}}
    93  	return a, nil
    94  }
    95  
    96  var __1561059284_add_waku_keysUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\xb1\x0a\xc2\x40\x0c\x06\xe0\xfd\x9e\xe2\x1f\x15\x7c\x03\xa7\xbb\x33\x6a\x30\x26\x12\x52\x6a\xa7\x52\xb4\xa0\xdc\xa8\x22\x7d\xfb\x7e\xd5\x29\x07\x21\x72\x11\xc2\x7f\x6a\xbf\xb1\xcd\xcb\x07\x9b\x04\x3c\x5e\xd3\x77\x7c\x3f\x11\x74\x0f\xdc\x9c\xaf\xd9\x07\x5c\x68\x80\x29\xaa\xe9\x51\xb8\x06\xf8\xa4\xe6\xb4\x4b\x40\x9b\x17\x14\xb1\x02\xb5\x80\x76\x22\x69\x8b\x9e\xe3\x6c\x5d\xc0\xad\xe7\xc3\x3e\xad\x01\x00\x00\xff\xff\xbc\x45\x31\x54\x6d\x00\x00\x00")
    97  
    98  func _1561059284_add_waku_keysUpSqlBytes() ([]byte, error) {
    99  	return bindataRead(
   100  		__1561059284_add_waku_keysUpSql,
   101  		"1561059284_add_waku_keys.up.sql",
   102  	)
   103  }
   104  
   105  func _1561059284_add_waku_keysUpSql() (*asset, error) {
   106  	bytes, err := _1561059284_add_waku_keysUpSqlBytes()
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  
   111  	info := bindataFileInfo{name: "1561059284_add_waku_keys.up.sql", size: 109, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)}
   112  	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa9, 0x5c, 0x8, 0x32, 0xef, 0x12, 0x88, 0x21, 0xd, 0x7a, 0x42, 0x4d, 0xe7, 0x2d, 0x6c, 0x99, 0xb6, 0x1, 0xf1, 0xba, 0x2c, 0x40, 0x8d, 0xa9, 0x4b, 0xe6, 0xc4, 0x21, 0xec, 0x47, 0x6b, 0xf7}}
   113  	return a, nil
   114  }
   115  
   116  var __1616691080_add_wakuv2_keysDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x4f\xcc\x2e\x2d\x33\x8a\xcf\x4e\xad\x2c\xb6\xe6\x02\x04\x00\x00\xff\xff\x27\xed\xf4\x49\x18\x00\x00\x00")
   117  
   118  func _1616691080_add_wakuv2_keysDownSqlBytes() ([]byte, error) {
   119  	return bindataRead(
   120  		__1616691080_add_wakuv2_keysDownSql,
   121  		"1616691080_add_wakuV2_keys.down.sql",
   122  	)
   123  }
   124  
   125  func _1616691080_add_wakuv2_keysDownSql() (*asset, error) {
   126  	bytes, err := _1616691080_add_wakuv2_keysDownSqlBytes()
   127  	if err != nil {
   128  		return nil, err
   129  	}
   130  
   131  	info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.down.sql", size: 24, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)}
   132  	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x42, 0xb6, 0x23, 0x70, 0xb8, 0x63, 0x18, 0x61, 0xea, 0x35, 0x6e, 0xae, 0xe9, 0x71, 0x89, 0xa, 0xa5, 0x72, 0xa2, 0x64, 0xaa, 0x45, 0x1, 0xf, 0xfc, 0xee, 0x1b, 0xd9, 0xd2, 0x27, 0xf4, 0xe2}}
   133  	return a, nil
   134  }
   135  
   136  var __1616691080_add_wakuv2_keysUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x04\xc0\x3d\xcb\xc2\x40\x0c\x07\xf0\xfd\x3e\xc5\x7f\x7c\x1e\x70\x72\x75\xba\x3b\xa3\x06\x63\x22\x21\xa5\x76\x2a\x45\x0b\xca\x8d\xbe\xd1\x6f\xef\xaf\x3a\xe5\x20\x44\x2e\x42\xf8\x4e\xed\xfd\x59\x8f\x6d\x5e\x9e\xf8\x4b\xc0\xf5\x3e\xbd\xc6\xc7\x0d\x41\x97\xc0\xd9\xf9\x94\x7d\xc0\x91\x06\x98\xa2\x9a\xee\x84\x6b\x80\xf7\x6a\x4e\xab\x04\xb4\x79\x41\x11\x2b\x50\x0b\x68\x27\x92\xfe\xd1\x73\x1c\xac\x0b\xb8\xf5\xbc\xdd\xa4\x5f\x00\x00\x00\xff\xff\xae\xa2\xa6\xca\x6f\x00\x00\x00")
   137  
   138  func _1616691080_add_wakuv2_keysUpSqlBytes() ([]byte, error) {
   139  	return bindataRead(
   140  		__1616691080_add_wakuv2_keysUpSql,
   141  		"1616691080_add_wakuV2_keys.up.sql",
   142  	)
   143  }
   144  
   145  func _1616691080_add_wakuv2_keysUpSql() (*asset, error) {
   146  	bytes, err := _1616691080_add_wakuv2_keysUpSqlBytes()
   147  	if err != nil {
   148  		return nil, err
   149  	}
   150  
   151  	info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.up.sql", size: 111, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)}
   152  	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0xf0, 0x97, 0x25, 0xfe, 0x96, 0x2c, 0xa8, 0x62, 0x4a, 0x71, 0x75, 0xff, 0x5f, 0x43, 0x1e, 0x71, 0x53, 0xf1, 0xde, 0xf, 0xcf, 0xcd, 0x87, 0x15, 0x61, 0x9d, 0x25, 0x2e, 0xaf, 0x18, 0x99}}
   153  	return a, nil
   154  }
   155  
   156  var __1634723014_add_wakuv2_keysUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x1c\xcc\xbd\x0a\xc2\x40\x0c\x07\xf0\xfd\x9e\xe2\x3f\x2a\x38\xb9\x3a\xf5\xce\x54\x83\x67\x22\x69\x4a\xdb\xa9\x14\x2d\x28\x37\xfa\x45\xdf\x5e\xf0\x05\x7e\xc9\xa8\x72\x82\x57\x31\x13\xb8\x86\xa8\x83\x7a\x6e\xbc\xc1\x77\x2a\xef\xcf\x76\x2c\xf3\xf2\xc4\x2a\x00\xd7\xfb\xf4\x1a\x1f\x37\x38\xf5\x8e\x8b\xf1\xb9\xb2\x01\x27\x1a\xa0\x82\xa4\x52\x67\x4e\x0e\x3e\x88\x1a\x6d\x02\x50\xe6\x05\x31\x6b\xfc\x93\xd2\xe6\x1c\xd6\xe8\xd8\x8f\xda\x3a\x4c\x3b\xde\xef\xc2\x2f\x00\x00\xff\xff\x56\x21\xd6\x90\x7d\x00\x00\x00")
   157  
   158  func _1634723014_add_wakuv2_keysUpSqlBytes() ([]byte, error) {
   159  	return bindataRead(
   160  		__1634723014_add_wakuv2_keysUpSql,
   161  		"1634723014_add_wakuV2_keys.up.sql",
   162  	)
   163  }
   164  
   165  func _1634723014_add_wakuv2_keysUpSql() (*asset, error) {
   166  	bytes, err := _1634723014_add_wakuv2_keysUpSqlBytes()
   167  	if err != nil {
   168  		return nil, err
   169  	}
   170  
   171  	info := bindataFileInfo{name: "1634723014_add_wakuV2_keys.up.sql", size: 125, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)}
   172  	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0xe1, 0x7a, 0x1e, 0x6, 0xad, 0x1b, 0x37, 0xdb, 0xea, 0x94, 0xaf, 0xe0, 0x7d, 0xc9, 0xd6, 0xda, 0x52, 0x71, 0x8a, 0x44, 0xb3, 0xa6, 0x7b, 0x1e, 0x90, 0xdb, 0x1e, 0x5a, 0xa, 0x40, 0x26}}
   173  	return a, nil
   174  }
   175  
   176  var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x8f\xbd\x6a\xec\x30\x10\x85\x7b\x3f\xc5\x61\x9b\x6d\xae\xa5\x1b\x08\x04\x02\x29\x52\xa6\xcf\x0b\xcc\x4a\x63\x69\x58\x4b\x72\x34\xe3\xfd\x79\xfb\xe0\xc5\xc5\x76\x99\xf2\xc0\x77\xce\x37\xde\xe3\x3b\x8b\x62\x92\x99\x21\x8a\xca\x81\x55\xa9\xdf\x71\xe2\x40\xab\x32\x0e\x49\x2c\xaf\x27\x17\x5a\xf1\x6a\x64\xab\x8e\x52\x7c\x91\xd4\xc9\xd8\x5f\x5e\x0f\x83\xf7\x08\x54\x8f\x86\x4c\x35\xce\xfc\xe8\x52\xa8\x51\x37\xa9\x09\x57\xb1\x0c\xc2\xd2\x79\x92\x9b\xc3\xa7\x61\x66\x52\x83\x65\xb2\xa3\xc2\x32\x23\x90\xf2\x56\x33\xb5\x8e\xd4\xc6\x93\xd4\x48\x46\x6e\x8b\xbe\xa6\xa7\x64\x33\x0c\x34\xcf\x1c\x31\xf5\x56\x1e\xac\x52\x61\x44\xe9\x1c\xac\xf5\xfb\x3f\x90\x2a\x1b\x2a\x15\xd6\x8d\xcf\x74\x61\xd4\xb6\xcf\x83\x6a\xfc\xfb\x23\x5c\x5b\x3f\x2b\x48\xc1\xb7\x85\x83\x71\x74\xc3\xb0\x50\x38\x53\x62\xe8\xcf\x2c\xc6\xc3\xe0\x7d\x6a\xef\x89\x2b\x6f\xd4\xb3\xe3\x58\x5a\x34\x29\xfc\xf1\xf2\xf6\x7f\x3f\x8c\xcb\x39\xed\x24\xc6\x06\xe7\xf6\x39\x69\x55\x5d\x6a\x70\xc3\x6f\x00\x00\x00\xff\xff\xc5\xaf\x3c\xfb\x89\x01\x00\x00")
   177  
   178  func docGoBytes() ([]byte, error) {
   179  	return bindataRead(
   180  		_docGo,
   181  		"doc.go",
   182  	)
   183  }
   184  
   185  func docGo() (*asset, error) {
   186  	bytes, err := docGoBytes()
   187  	if err != nil {
   188  		return nil, err
   189  	}
   190  
   191  	info := bindataFileInfo{name: "doc.go", size: 393, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)}
   192  	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0x22, 0x63, 0x1, 0xf1, 0xb5, 0xd4, 0x48, 0xa8, 0x75, 0x3f, 0xa8, 0x3, 0x83, 0x19, 0x1, 0x27, 0xa2, 0xe8, 0x9, 0x94, 0x46, 0x61, 0xf, 0xcb, 0xb5, 0x5e, 0xbd, 0x35, 0xd5, 0x6e, 0x51}}
   193  	return a, nil
   194  }
   195  
   196  // Asset loads and returns the asset for the given name.
   197  // It returns an error if the asset could not be found or
   198  // could not be loaded.
   199  func Asset(name string) ([]byte, error) {
   200  	canonicalName := strings.Replace(name, "\\", "/", -1)
   201  	if f, ok := _bindata[canonicalName]; ok {
   202  		a, err := f()
   203  		if err != nil {
   204  			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
   205  		}
   206  		return a.bytes, nil
   207  	}
   208  	return nil, fmt.Errorf("Asset %s not found", name)
   209  }
   210  
   211  // AssetString returns the asset contents as a string (instead of a []byte).
   212  func AssetString(name string) (string, error) {
   213  	data, err := Asset(name)
   214  	return string(data), err
   215  }
   216  
   217  // MustAsset is like Asset but panics when Asset would return an error.
   218  // It simplifies safe initialization of global variables.
   219  func MustAsset(name string) []byte {
   220  	a, err := Asset(name)
   221  	if err != nil {
   222  		panic("asset: Asset(" + name + "): " + err.Error())
   223  	}
   224  
   225  	return a
   226  }
   227  
   228  // MustAssetString is like AssetString but panics when Asset would return an
   229  // error. It simplifies safe initialization of global variables.
   230  func MustAssetString(name string) string {
   231  	return string(MustAsset(name))
   232  }
   233  
   234  // AssetInfo loads and returns the asset info for the given name.
   235  // It returns an error if the asset could not be found or
   236  // could not be loaded.
   237  func AssetInfo(name string) (os.FileInfo, error) {
   238  	canonicalName := strings.Replace(name, "\\", "/", -1)
   239  	if f, ok := _bindata[canonicalName]; ok {
   240  		a, err := f()
   241  		if err != nil {
   242  			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
   243  		}
   244  		return a.info, nil
   245  	}
   246  	return nil, fmt.Errorf("AssetInfo %s not found", name)
   247  }
   248  
   249  // AssetDigest returns the digest of the file with the given name. It returns an
   250  // error if the asset could not be found or the digest could not be loaded.
   251  func AssetDigest(name string) ([sha256.Size]byte, error) {
   252  	canonicalName := strings.Replace(name, "\\", "/", -1)
   253  	if f, ok := _bindata[canonicalName]; ok {
   254  		a, err := f()
   255  		if err != nil {
   256  			return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
   257  		}
   258  		return a.digest, nil
   259  	}
   260  	return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
   261  }
   262  
   263  // Digests returns a map of all known files and their checksums.
   264  func Digests() (map[string][sha256.Size]byte, error) {
   265  	mp := make(map[string][sha256.Size]byte, len(_bindata))
   266  	for name := range _bindata {
   267  		a, err := _bindata[name]()
   268  		if err != nil {
   269  			return nil, err
   270  		}
   271  		mp[name] = a.digest
   272  	}
   273  	return mp, nil
   274  }
   275  
   276  // AssetNames returns the names of the assets.
   277  func AssetNames() []string {
   278  	names := make([]string, 0, len(_bindata))
   279  	for name := range _bindata {
   280  		names = append(names, name)
   281  	}
   282  	return names
   283  }
   284  
   285  // _bindata is a table, holding each asset generator, mapped to its name.
   286  var _bindata = map[string]func() (*asset, error){
   287  	"1561059284_add_waku_keys.down.sql":   _1561059284_add_waku_keysDownSql,
   288  	"1561059284_add_waku_keys.up.sql":     _1561059284_add_waku_keysUpSql,
   289  	"1616691080_add_wakuV2_keys.down.sql": _1616691080_add_wakuv2_keysDownSql,
   290  	"1616691080_add_wakuV2_keys.up.sql":   _1616691080_add_wakuv2_keysUpSql,
   291  	"1634723014_add_wakuV2_keys.up.sql":   _1634723014_add_wakuv2_keysUpSql,
   292  	"doc.go":                              docGo,
   293  }
   294  
   295  // AssetDebug is true if the assets were built with the debug flag enabled.
   296  const AssetDebug = false
   297  
   298  // AssetDir returns the file names below a certain
   299  // directory embedded in the file by go-bindata.
   300  // For example if you run go-bindata on data/... and data contains the
   301  // following hierarchy:
   302  //
   303  //	data/
   304  //	  foo.txt
   305  //	  img/
   306  //	    a.png
   307  //	    b.png
   308  //
   309  // then AssetDir("data") would return []string{"foo.txt", "img"},
   310  // AssetDir("data/img") would return []string{"a.png", "b.png"},
   311  // AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
   312  // AssetDir("") will return []string{"data"}.
   313  func AssetDir(name string) ([]string, error) {
   314  	node := _bintree
   315  	if len(name) != 0 {
   316  		canonicalName := strings.Replace(name, "\\", "/", -1)
   317  		pathList := strings.Split(canonicalName, "/")
   318  		for _, p := range pathList {
   319  			node = node.Children[p]
   320  			if node == nil {
   321  				return nil, fmt.Errorf("Asset %s not found", name)
   322  			}
   323  		}
   324  	}
   325  	if node.Func != nil {
   326  		return nil, fmt.Errorf("Asset %s not found", name)
   327  	}
   328  	rv := make([]string, 0, len(node.Children))
   329  	for childName := range node.Children {
   330  		rv = append(rv, childName)
   331  	}
   332  	return rv, nil
   333  }
   334  
   335  type bintree struct {
   336  	Func     func() (*asset, error)
   337  	Children map[string]*bintree
   338  }
   339  
   340  var _bintree = &bintree{nil, map[string]*bintree{
   341  	"1561059284_add_waku_keys.down.sql":   {_1561059284_add_waku_keysDownSql, map[string]*bintree{}},
   342  	"1561059284_add_waku_keys.up.sql":     {_1561059284_add_waku_keysUpSql, map[string]*bintree{}},
   343  	"1616691080_add_wakuV2_keys.down.sql": {_1616691080_add_wakuv2_keysDownSql, map[string]*bintree{}},
   344  	"1616691080_add_wakuV2_keys.up.sql":   {_1616691080_add_wakuv2_keysUpSql, map[string]*bintree{}},
   345  	"1634723014_add_wakuV2_keys.up.sql":   {_1634723014_add_wakuv2_keysUpSql, map[string]*bintree{}},
   346  	"doc.go":                              {docGo, map[string]*bintree{}},
   347  }}
   348  
   349  // RestoreAsset restores an asset under the given directory.
   350  func RestoreAsset(dir, name string) error {
   351  	data, err := Asset(name)
   352  	if err != nil {
   353  		return err
   354  	}
   355  	info, err := AssetInfo(name)
   356  	if err != nil {
   357  		return err
   358  	}
   359  	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
   360  	if err != nil {
   361  		return err
   362  	}
   363  	err = os.WriteFile(_filePath(dir, name), data, info.Mode())
   364  	if err != nil {
   365  		return err
   366  	}
   367  	return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
   368  }
   369  
   370  // RestoreAssets restores an asset under the given directory recursively.
   371  func RestoreAssets(dir, name string) error {
   372  	children, err := AssetDir(name)
   373  	// File
   374  	if err != nil {
   375  		return RestoreAsset(dir, name)
   376  	}
   377  	// Dir
   378  	for _, child := range children {
   379  		err = RestoreAssets(dir, filepath.Join(name, child))
   380  		if err != nil {
   381  			return err
   382  		}
   383  	}
   384  	return nil
   385  }
   386  
   387  func _filePath(dir, name string) string {
   388  	canonicalName := strings.Replace(name, "\\", "/", -1)
   389  	return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
   390  }