320 lines
12 KiB
Go
320 lines
12 KiB
Go
// Code generated by go-bindata. DO NOT EDIT.
|
|
// sources:
|
|
// 0001_app.down.sql (387B)
|
|
// 0001_app.up.sql (2.876kB)
|
|
// doc.go (74B)
|
|
|
|
package migrations
|
|
|
|
import (
|
|
"bytes"
|
|
"compress/gzip"
|
|
"crypto/sha256"
|
|
"fmt"
|
|
"io"
|
|
"io/ioutil"
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
func bindataRead(data []byte, name string) ([]byte, error) {
|
|
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
|
if err != nil {
|
|
return nil, fmt.Errorf("read %q: %v", name, err)
|
|
}
|
|
|
|
var buf bytes.Buffer
|
|
_, err = io.Copy(&buf, gz)
|
|
clErr := gz.Close()
|
|
|
|
if err != nil {
|
|
return nil, fmt.Errorf("read %q: %v", name, err)
|
|
}
|
|
if clErr != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return buf.Bytes(), nil
|
|
}
|
|
|
|
type asset struct {
|
|
bytes []byte
|
|
info os.FileInfo
|
|
digest [sha256.Size]byte
|
|
}
|
|
|
|
type bindataFileInfo struct {
|
|
name string
|
|
size int64
|
|
mode os.FileMode
|
|
modTime time.Time
|
|
}
|
|
|
|
func (fi bindataFileInfo) Name() string {
|
|
return fi.name
|
|
}
|
|
func (fi bindataFileInfo) Size() int64 {
|
|
return fi.size
|
|
}
|
|
func (fi bindataFileInfo) Mode() os.FileMode {
|
|
return fi.mode
|
|
}
|
|
func (fi bindataFileInfo) ModTime() time.Time {
|
|
return fi.modTime
|
|
}
|
|
func (fi bindataFileInfo) IsDir() bool {
|
|
return false
|
|
}
|
|
func (fi bindataFileInfo) Sys() interface{} {
|
|
return nil
|
|
}
|
|
|
|
var __0001_appDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x8e\xcd\x0e\x82\x40\x0c\x84\xef\x3c\x05\xef\xc1\x49\x03\x07\x13\xa3\xc6\x78\xf0\xd6\xac\x4b\x85\x46\xd8\xae\x6d\xf1\xe7\xed\x4d\x4c\xfc\x59\x85\xeb\x37\x93\x6f\xa6\xdc\xae\x37\xf9\x6e\x36\x5f\x56\xb9\xa2\x19\x85\x46\x8b\xec\x0b\x3a\xef\x79\x08\x96\xc2\x83\xf0\x55\x51\xc6\x21\xb4\xa4\xc6\x72\x4f\xc2\xda\xc5\x98\xd6\x23\x4a\x4f\xaa\xc4\x21\xe5\x26\x2e\xe8\xf1\x4f\xde\xb1\x3f\x8d\x3f\x03\x63\x18\x89\x7b\x47\x9d\xa2\x5c\x7e\x4d\x1f\x0e\x82\xe7\x01\xd5\xa0\x71\xef\x6f\x8b\x55\x59\xed\xa7\x3a\xe0\x5b\x67\x40\x35\x50\x7d\x9b\x72\x1a\x47\xf2\x93\x8b\x4f\xc1\x4b\x29\x2e\x34\xa8\x45\xf6\x08\x00\x00\xff\xff\xef\x20\x3b\x16\x83\x01\x00\x00")
|
|
|
|
func _0001_appDownSqlBytes() ([]byte, error) {
|
|
return bindataRead(
|
|
__0001_appDownSql,
|
|
"0001_app.down.sql",
|
|
)
|
|
}
|
|
|
|
func _0001_appDownSql() (*asset, error) {
|
|
bytes, err := _0001_appDownSqlBytes()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
info := bindataFileInfo{name: "0001_app.down.sql", size: 387, mode: os.FileMode(0644), modTime: time.Unix(1567701212, 0)}
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbc, 0x9c, 0xd2, 0xe1, 0x1d, 0x8, 0x34, 0x6a, 0xc8, 0x37, 0x13, 0xb3, 0x9f, 0x26, 0x23, 0x33, 0xd4, 0x25, 0x8, 0xed, 0x53, 0xe6, 0xd, 0x46, 0xc9, 0xf4, 0x24, 0xf8, 0x1, 0x1f, 0xf5, 0xc8}}
|
|
return a, nil
|
|
}
|
|
|
|
var __0001_appUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x56\x4d\x93\xaa\x38\x14\xdd\xf3\x2b\xb2\xd4\x2a\x36\xb3\x7e\x2b\xd4\x68\x53\xc3\xc0\x0c\xe2\x74\xbf\x55\x2a\x42\x44\x4a\x20\xbc\x24\xb6\xed\xbf\x9f\xca\x17\xa0\x02\xb6\xf3\x76\x24\xf7\xe6\x78\xce\xb9\x37\x37\x2e\x63\xe8\x25\x10\x24\xde\x22\x80\xc0\x5f\x83\x30\x4a\x00\xfc\xf0\xb7\xc9\x16\x70\x22\x44\x51\xe7\x1c\xcc\x1c\x71\x6d\x08\xf8\xd7\x8b\x97\x6f\x5e\x0c\xfe\x8e\xfd\xbf\xbc\xf8\x27\xf8\x13\xfe\x74\x9d\x4f\x5c\x9e\x09\x58\x04\xd1\xc2\x99\x83\x77\x3f\x79\x8b\x76\x09\x88\xa3\x77\x7f\xf5\xc3\x71\x26\xc0\x71\x9a\xd2\x73\x2d\x24\x38\xce\x32\x46\x38\x1f\xc6\xbf\xe0\xb2\x24\x02\x2c\xa2\x28\x80\x5e\xe8\x3a\xe9\x11\xf7\x56\x8a\x57\x02\x3f\x12\xd7\xe1\x82\x32\x9c\xdb\x55\x73\xde\x9f\xc8\x55\xf1\x72\x9d\x06\x8b\xa3\xd9\xaf\x71\x65\x53\x52\x5a\x52\xa6\xbe\xc7\x99\xef\x42\xff\x9f\x1d\x04\x7e\xb8\x82\x1f\xe0\x5c\x17\xbf\xce\x04\x69\x46\xc8\xb2\x8e\xc2\x9e\x16\x1d\x9b\x83\xf7\x37\x18\xc3\x76\xf9\x63\x0a\x4e\x0a\x1a\x06\x93\x91\x16\x4a\x2d\xa6\x2d\xdd\x33\x7a\xe1\x84\x49\x4b\x8b\x4c\x09\xbb\xb5\xb2\xd5\xae\x0e\x85\xbb\x20\x70\x1d\x51\x54\x84\x0b\x5c\x35\x60\xb7\xdd\xf8\x9b\x10\xae\xc0\xc2\xdf\xf8\x61\xe2\x3a\x19\x6e\x1a\xeb\x34\x58\xc1\xb5\xb7\x0b\x12\x70\xc0\x25\x27\xae\x73\x2c\xa4\xdd\x57\xbf\xce\xc8\x17\xd8\x85\x5b\x7d\xd2\x0f\x27\xac\x9c\x62\x8c\x0c\x1e\x98\x39\x66\x0b\x59\x05\x1d\x55\x9b\xa3\xab\xb7\x8e\x62\xe8\x6f\x42\xa9\x6c\xd6\x9d\x99\x83\x18\xae\x61\x0c\xc3\x25\xec\xd0\x67\x72\x3f\x92\x1a\x02\x98\x40\xb0\xf4\xb6\x4b\x6f\x05\x9d\x27\x6e\x4a\xf9\xd2\xca\xce\xb5\x9e\x99\xaf\xc9\x6c\x08\xab\x0a\xce\x0b\x5a\x4b\x40\x09\x8c\x86\x6a\xd1\xa5\xdd\x47\xfa\x62\xdb\xe3\x37\x5a\x15\xdb\x99\xde\x1e\x96\x3a\x45\x50\x30\x5c\xf3\x83\x6e\x9d\x9a\x88\x0b\x65\x27\x59\x80\xb6\xb0\xba\x25\xfa\xb5\xc0\xfc\xd8\xde\xd7\x6e\xfb\xfe\x26\x77\x91\x7d\x79\x42\x23\x87\xc4\x97\xb9\xa6\x9c\xd4\x19\x61\x03\x19\x8c\xa4\xa4\x68\x84\x49\x2b\x69\x6e\xbe\x6e\xa6\xd2\xb0\x5b\x9d\x1a\xd7\x52\xb8\xed\x91\x92\xa6\x27\xde\x4f\xd3\x29\x0f\x1e\xba\xce\x32\x0a\xb7\x49\xec\x49\x23\xcc\xd5\xb5\xb6\xa1\x86\x30\x7b\x85\xd5\xb7\x81\xb3\xf7\x7d\x26\x31\x5d\x93\xe0\x76\xbf\x35\x7f\xd6\x83\x9a\xdd\x6f\x16\xa5\x3e\x57\x7b\xc2\x1e\xd3\x7b\x57\x7f\x1c\x92\xe0\x4c\xcd\x80\x76\x00\xac\xbd\x60\x3b\x68\x86\xe2\x3a\xa8\xfe\xde\xdc\xd1\xc3\x9a\xe9\x33\x0c\x9d\xf5\xd4\x3b\x3b\x47\x91\xa0\xe8\x35\x1f\xa7\xbb\x78\xcc\x4e\x7e\xad\x53\xa0\x06\xe7\x44\xff\x19\xee\xd3\x1d\x68\x93\xbe\xd5\x83\x15\x6e\x9a\xa2\xce\xd1\x81\x32\x64\x24\xb7\x8a\x07\x9d\xb4\x6d\xd8\xd1\x79\xa5\x23\x2b\x5c\x94\x9c\xb0\x4f\x3d\x2b\x00\x00\xa0\xc8\x86\x1f\x6e\x19\x53\x53\xee\xd1\x46\x19\x1a\x37\x59\x46\x1b\xcc\xf9\x85\xb2\x16\x5a\xef\x1e\x4a\x42\xc4\xc3\x89\xd7\x66\x71\x27\x00\x31\xf2\xeb\x4c\xb8\x40\x39\x6e\xac\x98\x1c\x37\xe8\xc0\x68\x75\xf3\xa6\xc1\x0d\xbc\xe7\x27\xf3\x04\x7d\x96\x35\xf8\x0a\xcb\x80\x7a\xf3\xef\x5f\xb8\x71\x1d\xfa\xff\xc2\x08\x73\x64\xc0\x50\x91\x7d\xc9\x96\x19\x15\x68\xf2\xbe\x5d\x60\x24\x68\x53\xa4\xd6\x19\xb5\x18\xaf\xb4\x01\xe7\xb7\x05\x2b\x31\x17\x96\x45\xeb\x91\x9d\x24\x7f\xfc\xef\xc2\xa9\x1f\xb3\xe2\x18\xae\x73\x62\x59\x5a\x63\x47\x79\x96\xf4\x42\x3a\x4e\xba\xd6\x86\x98\x4e\x38\x16\xf9\xb1\x9f\x21\xa8\x8d\x3f\xd2\xfd\x2f\x00\x00\xff\xff\x86\xe7\xc8\x0b\x3c\x0b\x00\x00")
|
|
|
|
func _0001_appUpSqlBytes() ([]byte, error) {
|
|
return bindataRead(
|
|
__0001_appUpSql,
|
|
"0001_app.up.sql",
|
|
)
|
|
}
|
|
|
|
func _0001_appUpSql() (*asset, error) {
|
|
bytes, err := _0001_appUpSqlBytes()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
info := bindataFileInfo{name: "0001_app.up.sql", size: 2876, mode: os.FileMode(0644), modTime: time.Unix(1567701215, 0)}
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0x65, 0x8f, 0x50, 0xd3, 0x89, 0x74, 0x2e, 0x23, 0x73, 0x25, 0xbe, 0x5b, 0x53, 0x39, 0x3f, 0x4a, 0x65, 0x55, 0x39, 0x20, 0x10, 0xaa, 0xa6, 0xb9, 0xd0, 0x4c, 0xfa, 0x86, 0xaf, 0xac, 0xb0}}
|
|
return a, nil
|
|
}
|
|
|
|
var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00")
|
|
|
|
func docGoBytes() ([]byte, error) {
|
|
return bindataRead(
|
|
_docGo,
|
|
"doc.go",
|
|
)
|
|
}
|
|
|
|
func docGo() (*asset, error) {
|
|
bytes, err := docGoBytes()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1566753968, 0)}
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}}
|
|
return a, nil
|
|
}
|
|
|
|
// Asset loads and returns the asset for the given name.
|
|
// It returns an error if the asset could not be found or
|
|
// could not be loaded.
|
|
func Asset(name string) ([]byte, error) {
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
if f, ok := _bindata[canonicalName]; ok {
|
|
a, err := f()
|
|
if err != nil {
|
|
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
|
}
|
|
return a.bytes, nil
|
|
}
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
|
|
// AssetString returns the asset contents as a string (instead of a []byte).
|
|
func AssetString(name string) (string, error) {
|
|
data, err := Asset(name)
|
|
return string(data), err
|
|
}
|
|
|
|
// MustAsset is like Asset but panics when Asset would return an error.
|
|
// It simplifies safe initialization of global variables.
|
|
func MustAsset(name string) []byte {
|
|
a, err := Asset(name)
|
|
if err != nil {
|
|
panic("asset: Asset(" + name + "): " + err.Error())
|
|
}
|
|
|
|
return a
|
|
}
|
|
|
|
// MustAssetString is like AssetString but panics when Asset would return an
|
|
// error. It simplifies safe initialization of global variables.
|
|
func MustAssetString(name string) string {
|
|
return string(MustAsset(name))
|
|
}
|
|
|
|
// AssetInfo loads and returns the asset info for the given name.
|
|
// It returns an error if the asset could not be found or
|
|
// could not be loaded.
|
|
func AssetInfo(name string) (os.FileInfo, error) {
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
if f, ok := _bindata[canonicalName]; ok {
|
|
a, err := f()
|
|
if err != nil {
|
|
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
|
}
|
|
return a.info, nil
|
|
}
|
|
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
|
}
|
|
|
|
// AssetDigest returns the digest of the file with the given name. It returns an
|
|
// error if the asset could not be found or the digest could not be loaded.
|
|
func AssetDigest(name string) ([sha256.Size]byte, error) {
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
if f, ok := _bindata[canonicalName]; ok {
|
|
a, err := f()
|
|
if err != nil {
|
|
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
|
|
}
|
|
return a.digest, nil
|
|
}
|
|
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
|
|
}
|
|
|
|
// Digests returns a map of all known files and their checksums.
|
|
func Digests() (map[string][sha256.Size]byte, error) {
|
|
mp := make(map[string][sha256.Size]byte, len(_bindata))
|
|
for name := range _bindata {
|
|
a, err := _bindata[name]()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
mp[name] = a.digest
|
|
}
|
|
return mp, nil
|
|
}
|
|
|
|
// AssetNames returns the names of the assets.
|
|
func AssetNames() []string {
|
|
names := make([]string, 0, len(_bindata))
|
|
for name := range _bindata {
|
|
names = append(names, name)
|
|
}
|
|
return names
|
|
}
|
|
|
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
|
var _bindata = map[string]func() (*asset, error){
|
|
"0001_app.down.sql": _0001_appDownSql,
|
|
|
|
"0001_app.up.sql": _0001_appUpSql,
|
|
|
|
"doc.go": docGo,
|
|
}
|
|
|
|
// AssetDir returns the file names below a certain
|
|
// directory embedded in the file by go-bindata.
|
|
// For example if you run go-bindata on data/... and data contains the
|
|
// following hierarchy:
|
|
// data/
|
|
// foo.txt
|
|
// img/
|
|
// a.png
|
|
// b.png
|
|
// then AssetDir("data") would return []string{"foo.txt", "img"},
|
|
// AssetDir("data/img") would return []string{"a.png", "b.png"},
|
|
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
|
|
// AssetDir("") will return []string{"data"}.
|
|
func AssetDir(name string) ([]string, error) {
|
|
node := _bintree
|
|
if len(name) != 0 {
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
pathList := strings.Split(canonicalName, "/")
|
|
for _, p := range pathList {
|
|
node = node.Children[p]
|
|
if node == nil {
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
}
|
|
}
|
|
if node.Func != nil {
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
rv := make([]string, 0, len(node.Children))
|
|
for childName := range node.Children {
|
|
rv = append(rv, childName)
|
|
}
|
|
return rv, nil
|
|
}
|
|
|
|
type bintree struct {
|
|
Func func() (*asset, error)
|
|
Children map[string]*bintree
|
|
}
|
|
|
|
var _bintree = &bintree{nil, map[string]*bintree{
|
|
"0001_app.down.sql": &bintree{_0001_appDownSql, map[string]*bintree{}},
|
|
"0001_app.up.sql": &bintree{_0001_appUpSql, map[string]*bintree{}},
|
|
"doc.go": &bintree{docGo, map[string]*bintree{}},
|
|
}}
|
|
|
|
// RestoreAsset restores an asset under the given directory.
|
|
func RestoreAsset(dir, name string) error {
|
|
data, err := Asset(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
info, err := AssetInfo(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
|
}
|
|
|
|
// RestoreAssets restores an asset under the given directory recursively.
|
|
func RestoreAssets(dir, name string) error {
|
|
children, err := AssetDir(name)
|
|
// File
|
|
if err != nil {
|
|
return RestoreAsset(dir, name)
|
|
}
|
|
// Dir
|
|
for _, child := range children {
|
|
err = RestoreAssets(dir, filepath.Join(name, child))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _filePath(dir, name string) string {
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
|
|
}
|