mirror of https://github.com/pressly/goose.git
Merged in ghthor/goose/postgres-fix (pull request #8: Fix goose_db_version table for postgres.)
commit
003f86c223
|
@ -244,12 +244,11 @@ func createVersionTable(db *sql.DB) error {
|
||||||
|
|
||||||
// create the table and insert an initial value of 0
|
// create the table and insert an initial value of 0
|
||||||
create := `CREATE TABLE goose_db_version (
|
create := `CREATE TABLE goose_db_version (
|
||||||
id int unsigned NOT NULL AUTO_INCREMENT,
|
id serial NOT NULL,
|
||||||
version_id bigint NOT NULL,
|
version_id bigint NOT NULL,
|
||||||
is_applied boolean NOT NULL,
|
is_applied boolean NOT NULL,
|
||||||
tstamp timestamp NULL default now(),
|
tstamp timestamp NULL default now(),
|
||||||
PRIMARY KEY(id),
|
PRIMARY KEY(id)
|
||||||
UNIQUE KEY id_tstamp (id, tstamp)
|
|
||||||
);`
|
);`
|
||||||
insert := "INSERT INTO goose_db_version (version_id, is_applied) VALUES (0, true);"
|
insert := "INSERT INTO goose_db_version (version_id, is_applied) VALUES (0, true);"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue