Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
75488c0e
Commit
75488c0e
authored
Dec 29, 2015
by
bobbyrullo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #250 from bobbyrullo/fix_dex
db, functional: make value column in key not pkey
parents
e2b4061f
c1f8effe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
3 deletions
+9
-3
key.go
db/key.go
+0
-1
0009_key_not_primary_key.sql
db/migrations/0009_key_not_primary_key.sql
+5
-0
assets.go
db/migrations/assets.go
+0
-0
migrations.go
db/migrations/migrations.go
+1
-1
db_test.go
functional/db_test.go
+3
-1
No files found.
db/key.go
View file @
75488c0e
...
...
@@ -27,7 +27,6 @@ func init() {
name
:
keyTableName
,
model
:
privateKeySetBlob
{},
autoinc
:
false
,
pkey
:
[]
string
{
"value"
},
})
}
...
...
db/migrations/0009_key_not_primary_key.sql
0 → 100644
View file @
75488c0e
-- +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"
;
db/migrations/assets.go
View file @
75488c0e
This diff is collapsed.
Click to expand it.
db/migrations/migrations.go
View file @
75488c0e
...
...
@@ -2,5 +2,5 @@ package migrations
// 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
functional/db_test.go
View file @
75488c0e
...
...
@@ -45,7 +45,9 @@ func connect(t *testing.T) *gorp.DbMap {
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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment