summaryrefslogtreecommitdiff
path: root/src/db/PhotoTable.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/PhotoTable.vala')
-rw-r--r--src/db/PhotoTable.vala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/db/PhotoTable.vala b/src/db/PhotoTable.vala
index f774df5..4304da8 100644
--- a/src/db/PhotoTable.vala
+++ b/src/db/PhotoTable.vala
@@ -162,7 +162,14 @@ public class PhotoTable : DatabaseTable {
// https://bugzilla.gnome.org/show_bug.cgi?id=742670
//
// 1) index on md5,file_format
- res = db.prepare_v2 ("CREATE UNIQUE INDEX IF NOT EXISTS PhotoTableMD5Format on PhotoTable(md5, file_format)", -1, out stmt);
+ res = db.prepare_v2 ("DROP INDEX IF EXISTS PhotoTableMD5Format", -1, out stmt);
+ assert (res == Sqlite.OK);
+ res = stmt.step ();
+ if (res != Sqlite.DONE) {
+ DatabaseTable.warning ("Failed to drop old PhotoTable index", res);
+ }
+
+ res = db.prepare_v2 ("CREATE INDEX IF NOT EXISTS PhotoTableMD5FormatV2 on PhotoTable(md5, file_format)", -1, out stmt);
assert (res == Sqlite.OK);
res = stmt.step ();
if (res != Sqlite.DONE) {