From a2e3fd92b0e5fb20b70a0ab0db1d00bc81cc77c1 Mon Sep 17 00:00:00 2001 From: "Owain G. Ainsworth" Date: Wed, 29 May 2013 17:54:46 +0100 Subject: [PATCH] Only try to drop the uniquetx index if it exists. Solves a corner case after a crash. --- sqlite3/sqlite.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlite3/sqlite.go b/sqlite3/sqlite.go index 2a152108..d8df4ae9 100644 --- a/sqlite3/sqlite.go +++ b/sqlite3/sqlite.go @@ -64,7 +64,7 @@ var txqueries []string = []string{ txtmpFetchLocationByShaStmt: "SELECT blockid, txoff, txlen FROM txtmp WHERE key = ?;", txMigrateCopy: "INSERT INTO tx (key, blockid, txoff, txlen, data) SELECT key, blockid, txoff, txlen, data FROM txtmp;", txMigrateClear: "DELETE from txtmp;", - txMigratePrep: "DROP index uniquetx;", + txMigratePrep: "DROP index IF EXISTS uniquetx;", txMigrateFinish: "CREATE UNIQUE INDEX IF NOT EXISTS uniquetx ON tx (key);", txMigrateCount: "SELECT COUNT(*) FROM txtmp;", txPragmaVacuumOn: "PRAGMA auto_vacuum = FULL;",