From 527ee49c389eca23798e64e44ce3859b86fac603 Mon Sep 17 00:00:00 2001 From: Abigail Walthall Date: Thu, 17 Jan 2013 09:34:37 -0500 Subject: [PATCH] Fix goose_db_version table for postgres. Tested with: * mysql Ver 15.1 Distrib 5.5.28a-MariaDB * psql (PostgreSQL) 9.2.2 --- migrate.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migrate.go b/migrate.go index b4b083f..fcc93e1 100644 --- a/migrate.go +++ b/migrate.go @@ -244,12 +244,11 @@ func createVersionTable(db *sql.DB) error { // create the table and insert an initial value of 0 create := `CREATE TABLE goose_db_version ( - id int unsigned NOT NULL AUTO_INCREMENT, + id serial NOT NULL, version_id bigint NOT NULL, is_applied boolean NOT NULL, tstamp timestamp NULL default now(), - PRIMARY KEY(id), - UNIQUE KEY id_tstamp (id, tstamp) + PRIMARY KEY(id) );` insert := "INSERT INTO goose_db_version (version_id, is_applied) VALUES (0, true);"