mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Update schema to fix uniqueness problems
This commit is contained in:
parent
4704162c1a
commit
f8776516fc
@ -122,8 +122,6 @@ CreateTables(mozIStorageConnection* aDBConn)
|
||||
"name TEXT NOT NULL, "
|
||||
"key_path TEXT NOT NULL, "
|
||||
"auto_increment INTEGER NOT NULL DEFAULT 0, "
|
||||
"readers INTEGER NOT NULL DEFAULT 0, "
|
||||
"is_writing INTEGER NOT NULL DEFAULT 1, "
|
||||
"PRIMARY KEY (id), "
|
||||
"UNIQUE (name)"
|
||||
");"
|
||||
@ -136,7 +134,7 @@ CreateTables(mozIStorageConnection* aDBConn)
|
||||
"id INTEGER, "
|
||||
"object_store_id INTEGER NOT NULL, "
|
||||
"data TEXT NOT NULL, "
|
||||
"key_value TEXT DEFAULT NULL, "
|
||||
"key_value TEXT DEFAULT NULL UNIQUE, "
|
||||
"PRIMARY KEY (id), "
|
||||
"FOREIGN KEY (object_store_id) REFERENCES object_store(id) ON DELETE "
|
||||
"CASCADE"
|
||||
@ -153,10 +151,9 @@ CreateTables(mozIStorageConnection* aDBConn)
|
||||
// Table `ai_object_data`
|
||||
rv = aDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
|
||||
"CREATE TABLE ai_object_data ("
|
||||
"id INTEGER, "
|
||||
"id INTEGER PRIMARY KEY, "
|
||||
"object_store_id INTEGER NOT NULL, "
|
||||
"data TEXT NOT NULL, "
|
||||
"PRIMARY KEY (id), "
|
||||
"FOREIGN KEY (object_store_id) REFERENCES object_store(id) ON DELETE "
|
||||
"CASCADE"
|
||||
");"
|
||||
|
@ -36,10 +36,12 @@
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
||||
is(event.result, key, "Correct key");
|
||||
|
||||
request = objectStore.add({}, key);
|
||||
request.onerror = grabEventAndContinueHandler;
|
||||
request.onsuccess = unexpectedSuccessHandler;
|
||||
event = yield;
|
||||
yield;
|
||||
|
||||
finishTest();
|
||||
yield;
|
||||
|
@ -178,13 +178,10 @@
|
||||
|
||||
is(event.result, key1, "addOrModify gave back the same key");
|
||||
|
||||
/*
|
||||
// XXXbent this should work, but doesn't...
|
||||
request = objectStore.add({id:10});
|
||||
request.onerror = grabEventAndContinueHandler;
|
||||
request.onsuccess = errorHandler;
|
||||
event = yield;
|
||||
*/
|
||||
request.onsuccess = unexpectedSuccessHandler;
|
||||
yield;
|
||||
|
||||
request = db.createObjectStore("bazing", "id", true);
|
||||
request.onerror = errorHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user