282 lines
9.3 KiB
Go
282 lines
9.3 KiB
Go
|
// Code generated by go-bindata.
|
||
|
// sources:
|
||
|
// 1536754952_initial_schema.down.sql
|
||
|
// 1536754952_initial_schema.up.sql
|
||
|
// static.go
|
||
|
// DO NOT EDIT!
|
||
|
|
||
|
package migrations
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"compress/gzip"
|
||
|
"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
|
||
|
}
|
||
|
|
||
|
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 __1536754952_initial_schemaDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x28\x4e\x2d\x2e\xce\xcc\xcf\x2b\xb6\xe6\x42\x12\x4c\x2a\xcd\x4b\xc9\x49\x45\x15\xcb\x4e\xad\x44\x15\x28\x4a\x2c\x49\xce\x48\x2d\x89\xcf\xcc\x4b\xcb\xb7\xe6\x02\x04\x00\x00\xff\xff\x72\x61\x3f\x92\x53\x00\x00\x00")
|
||
|
|
||
|
func _1536754952_initial_schemaDownSqlBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
__1536754952_initial_schemaDownSql,
|
||
|
"1536754952_initial_schema.down.sql",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func _1536754952_initial_schemaDownSql() (*asset, error) {
|
||
|
bytes, err := _1536754952_initial_schemaDownSqlBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "1536754952_initial_schema.down.sql", size: 83, mode: os.FileMode(420), modTime: time.Unix(1536915096, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
return a, nil
|
||
|
}
|
||
|
|
||
|
var __1536754952_initial_schemaUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x52\xc1\x8e\x9b\x30\x10\xbd\xe7\x2b\xe6\x98\x48\x39\xf4\xde\x13\xb0\x13\x84\x4a\xcd\xd6\x0b\x52\xf7\x64\x79\xe3\x69\xb0\x16\x1b\x64\x3b\xab\xe6\xef\x2b\x20\xa5\xb8\x65\xdb\xde\x98\xc7\x9b\x99\x37\xef\x39\xe3\x98\xd4\x08\x75\x92\x96\x08\x9e\xbc\xd7\xbd\xf5\xb0\xdf\x01\xa8\xd6\x41\x5a\x56\xe9\x71\xfa\xf6\x62\xb8\xbe\x74\xfa\x1c\x43\x4e\xbf\xc9\x40\x0b\xe6\xfa\x3e\x88\x73\x2b\xb5\x15\xaf\x74\x5b\x60\x4f\x56\xfd\x1d\xb6\x50\xb0\x1a\x73\xe4\xd3\x14\x3a\xbf\x6d\xd0\x57\x70\x44\xf7\x81\x86\x75\x3d\x58\x58\x97\x5a\x4d\x13\x80\x55\x35\xb0\xa6\x2c\xe1\x91\x17\x9f\x13\xfe\x0c\x9f\xf0\x79\xfc\xdf\xb0\xe2\x4b\x83\x7b\xad\x0e\x50\x31\xc8\x2a\x76\x2a\x8b\xac\x06\x8e\x8f\x65\x92\xe1\xee\xf0\x71\xb7\x8b\x3c\x7a\xa5\xdb\xec\xcf\xec\xc7\x22\x71\x59\x30\x0e\x35\xfe\x22\xec\xd5\xac\x75\x18\xf2\x5e\x5e\x68\x9b\x3f\x8b\x80\xfd\xbd\xef\xb8\x66\xff\xa7\xae\x97\xab\x55\x1d\xcd\xd2\xb4\x22\x1b\x74\xd8\x58\xa4\xad\x0f\xb2\xeb\x64\xd0\xbd\x15\x5a\x41\x8d\x5f\xeb\x88\x70\x8f\x34\x0e\x4a\x5f\x2c\x29\x31\xb8\x0d\xf5\x6b\x3b\x23\xa1\x45\xce\x2a\x8e\x63\x7b\xd0\x86\x7c\x90\x66\x80\x86\x3d\x15\x39\xc3\x07\x48\x8b\x7c\xf4\x26\xda\x4c\xdf\x07\xed\x48\x41\x5a\x55\x25\x26\x0c\x1e\xf0\x94\x34\x65\x0d\x1f\xfe\xbc\xd5\xc9\x70\x6e\x29\x08\x6d\xbf\xf5\xd3\xc1\xf3\xf1\xe2\xf7\xac\xa7\xb1\x43\x4b\x86\x9c\xec\xa2\x93\xde\x77\xc8\xdf\x8c\xa1\xe0\xde\x4b\xf6\x9f\x06\xde\xdf\xd3\xa2\xe8\xb8\xec\xda\x0c\x72\x6c\x39\x55\x1c\x8b\x9c\x4d\x16\xfe\x6a\x3c\x00\xc7\x13\x72\x64\x19\x3e\xfd\x4c\x77\x1f\x47\x71\x18\xad\xf9\x11\x00\x00\xff\xff\xa9\x50\xa8\xb2\xc2\x03\x00\x00")
|
||
|
|
||
|
func _1536754952_initial_schemaUpSqlBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
__1536754952_initial_schemaUpSql,
|
||
|
"1536754952_initial_schema.up.sql",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func _1536754952_initial_schemaUpSql() (*asset, error) {
|
||
|
bytes, err := _1536754952_initial_schemaUpSqlBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "1536754952_initial_schema.up.sql", size: 962, mode: os.FileMode(420), modTime: time.Unix(1536915096, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
return a, nil
|
||
|
}
|
||
|
|
||
|
var _staticGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\xcc\x41\x8a\x02\x31\x10\x46\xe1\x7d\x4e\xf1\x2f\x67\x60\x3a\xb5\x9f\x13\x0c\x83\x82\xa0\x17\xa8\x4e\x17\x95\xa2\xe9\xa4\x49\x95\xe2\xf1\xdd\x28\xe2\xf2\xc1\xe3\x23\xc2\x89\xcb\xca\x2a\xf0\xe0\xb0\x02\xd9\x66\x59\xfc\x55\x5f\xff\xe7\x1f\xfc\x5d\x8e\x87\x6f\x0c\xf1\x7e\x1d\x45\x1c\xc3\xb4\x06\xac\x45\x47\x54\xc1\x6c\x8d\x87\x89\xa7\xfd\x43\x4a\x89\x48\xfb\xaf\x4a\x93\xc1\x21\xd0\x3e\xcd\xd6\x16\x0e\xc6\xb4\xaf\x8a\xcd\x74\x70\x58\x6f\x8e\xa9\x23\x67\xca\x99\x5c\xc6\xcd\x8a\x38\x79\xad\x72\x0f\x2a\x95\x83\xde\x23\x3d\x81\xac\x1d\x39\x3d\x02\x00\x00\xff\xff\x7c\xfc\xfc\x0b\xbc\x00\x00\x00")
|
||
|
|
||
|
func staticGoBytes() ([]byte, error) {
|
||
|
return bindataRead(
|
||
|
_staticGo,
|
||
|
"static.go",
|
||
|
)
|
||
|
}
|
||
|
|
||
|
func staticGo() (*asset, error) {
|
||
|
bytes, err := staticGoBytes()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
info := bindataFileInfo{name: "static.go", size: 188, mode: os.FileMode(420), modTime: time.Unix(1536915096, 0)}
|
||
|
a := &asset{bytes: bytes, info: info}
|
||
|
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) {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
if f, ok := _bindata[cannonicalName]; 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)
|
||
|
}
|
||
|
|
||
|
// 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
|
||
|
}
|
||
|
|
||
|
// 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) {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
if f, ok := _bindata[cannonicalName]; 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)
|
||
|
}
|
||
|
|
||
|
// 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){
|
||
|
"1536754952_initial_schema.down.sql": _1536754952_initial_schemaDownSql,
|
||
|
"1536754952_initial_schema.up.sql": _1536754952_initial_schemaUpSql,
|
||
|
"static.go": staticGo,
|
||
|
}
|
||
|
|
||
|
// 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
|
||
|
// AssetDir("") will return []string{"data"}.
|
||
|
func AssetDir(name string) ([]string, error) {
|
||
|
node := _bintree
|
||
|
if len(name) != 0 {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
pathList := strings.Split(cannonicalName, "/")
|
||
|
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{
|
||
|
"1536754952_initial_schema.down.sql": &bintree{_1536754952_initial_schemaDownSql, map[string]*bintree{}},
|
||
|
"1536754952_initial_schema.up.sql": &bintree{_1536754952_initial_schemaUpSql, map[string]*bintree{}},
|
||
|
"static.go": &bintree{staticGo, 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
|
||
|
}
|
||
|
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// 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 {
|
||
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||
|
}
|
||
|
|