From 911e5f41a303a301bf20ad4df57ccbddd6bebd82 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 1 Jun 2017 14:47:06 +0200 Subject: [PATCH] doh. fix migration for sqlite --- store/datastore/ddl/migrate.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/store/datastore/ddl/migrate.go b/store/datastore/ddl/migrate.go index df07a273..d59e2014 100644 --- a/store/datastore/ddl/migrate.go +++ b/store/datastore/ddl/migrate.go @@ -51,12 +51,8 @@ func checkPriorMigration(db *sql.DB) error { // version 0.7 or higher and will fail. return errors.New("Please upgrade to 0.6 before upgrading to 0.7+") } - if _, err := db.Exec(createMigrationsTable); err != nil { - return err - } - if _, err := db.Exec(legacyMigrationsImport); err != nil { - return err - } + db.Exec(createMigrationsTable) + db.Exec(legacyMigrationsImport) return nil } @@ -74,7 +70,7 @@ LIMIT 1 ` var legacyMigrationsImport = ` -INSERT IGNORE INTO migrations (name) VALUES +INSERT INTO migrations (name) VALUES ('create-table-users') ,('create-table-repos') ,('create-table-builds') @@ -98,7 +94,7 @@ INSERT IGNORE INTO migrations (name) VALUES ` var createMigrationsTable = ` -CREATE TABLE IF NOT EXISTS migrations ( +CREATE TABLE migrations ( name VARCHAR(255) ,UNIQUE(name) )