Commit 71ec94aa authored by Jens Georg's avatar Jens Georg
Browse files

Fix issue with indexes on PhotoTable



 - thumbnail_md5 might actually not be unique for various reasons
 - Second index was a duplicate of the first instead of using thumbnail_md5
Signed-off-by: Jens Georg's avatarJens Georg <mail@jensge.org>

https://bugzilla.gnome.org/show_bug.cgi?id=742670
parent a44252bc
......@@ -170,7 +170,7 @@ public class PhotoTable : DatabaseTable {
}
// 2) index on thumbnail_md5,file_format
res = db.prepare_v2 ("CREATE UNIQUE INDEX IF NOT EXISTS PhotoTableThumbnailMD5Format on PhotoTable(md5, file_format)", -1, out stmt);
res = db.prepare_v2 ("CREATE INDEX IF NOT EXISTS PhotoTableThumbnailMD5Format on PhotoTable(thumbnail_md5, file_format)", -1, out stmt);
assert (res == Sqlite.OK);
res = stmt.step ();
if (res != Sqlite.DONE) {
......@@ -178,7 +178,7 @@ public class PhotoTable : DatabaseTable {
}
// 3) index on thumbnail_md5,md5
res = db.prepare_v2 ("CREATE UNIQUE INDEX IF NOT EXISTS PhotoTableThumbnailMD5MD5 on PhotoTable(thumbnail_md5, md5)", -1, out stmt);
res = db.prepare_v2 ("CREATE INDEX IF NOT EXISTS PhotoTableThumbnailMD5MD5 on PhotoTable(thumbnail_md5, md5)", -1, out stmt);
assert (res == Sqlite.OK);
res = stmt.step ();
if (res != Sqlite.DONE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment