Commit 75488c0e authored by bobbyrullo's avatar bobbyrullo

Merge pull request #250 from bobbyrullo/fix_dex

db, functional: make value column in key not pkey
parents e2b4061f c1f8effe
...@@ -27,7 +27,6 @@ func init() { ...@@ -27,7 +27,6 @@ func init() {
name: keyTableName, name: keyTableName,
model: privateKeySetBlob{}, model: privateKeySetBlob{},
autoinc: false, autoinc: false,
pkey: []string{"value"},
}) })
} }
......
-- +migrate Up
ALTER TABLE key ADD COLUMN tmp_value bytea;
UPDATE KEY SET tmp_value = value;
ALTER TABLE key DROP COLUMN value;
ALTER TABLE key RENAME COLUMN "tmp_value" to "value";
This diff is collapsed.
...@@ -2,5 +2,5 @@ package migrations ...@@ -2,5 +2,5 @@ package migrations
// To download go-bindata run `go get -u github.com/jteeuwen/go-bindata/...` // To download go-bindata run `go get -u github.com/jteeuwen/go-bindata/...`
//go:generate go-bindata -modtime=1 -pkg migrations -o assets.go ../ //go:generate go-bindata -modtime=1 -pkg migrations -o assets.go -ignore \.go$ -prefix "../.." ../../db/migrations
//go:generate gofmt -w assets.go //go:generate gofmt -w assets.go
...@@ -45,7 +45,9 @@ func connect(t *testing.T) *gorp.DbMap { ...@@ -45,7 +45,9 @@ func connect(t *testing.T) *gorp.DbMap {
panic(fmt.Sprintf("Unable to drop migration table: %v", err)) panic(fmt.Sprintf("Unable to drop migration table: %v", err))
} }
db.MigrateToLatest(c) if _, err = db.MigrateToLatest(c); err != nil {
panic(fmt.Sprintf("Unable to migrate: %v", err))
}
return c return c
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment