Fix a potential upgrade error due to the initial 1.5 migration step not adding a UNIQUE index to key in syncDeleteLog

This commit is contained in:
Dan Stillman 2008-12-29 10:31:29 +00:00
parent 38be4790a1
commit 2468ad5dfc

View file

@ -2150,7 +2150,7 @@ Zotero.Schema = new function(){
Zotero.DB.query("DROP INDEX syncDeleteLog_timestamp");
Zotero.DB.query("CREATE TABLE syncDeleteLog (\n syncObjectTypeID INT NOT NULL,\n key TEXT NOT NULL UNIQUE,\n timestamp INT NOT NULL,\n FOREIGN KEY (syncObjectTypeID) REFERENCES syncObjectTypes(syncObjectTypeID)\n);");
Zotero.DB.query("CREATE INDEX syncDeleteLog_timestamp ON syncDeleteLog(timestamp);");
Zotero.DB.query("INSERT INTO syncDeleteLog SELECT syncObjectTypeID, key, timestamp FROM syncDeleteLogOld");
Zotero.DB.query("INSERT IGNORE INTO syncDeleteLog SELECT syncObjectTypeID, key, timestamp FROM syncDeleteLogOld ORDER BY timestamp DESC");
Zotero.DB.query("DROP TABLE syncDeleteLogOld");
}
}