diff --git a/.sqlx/query-526c4a9326db7f026eee15cca358943b0546fe56fc09204f1dfe90e2614f99b9.json b/.sqlx/query-526c4a9326db7f026eee15cca358943b0546fe56fc09204f1dfe90e2614f99b9.json new file mode 100644 index 0000000..4a92d2d --- /dev/null +++ b/.sqlx/query-526c4a9326db7f026eee15cca358943b0546fe56fc09204f1dfe90e2614f99b9.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n INSERT INTO addressobjectchangelog (principal, addressbook_id, object_id, \"operation\", synctoken)\n VALUES (?1, ?2, ?3, ?4, (\n SELECT synctoken FROM addressbooks WHERE (principal, id) = (?1, ?2)\n ))", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "526c4a9326db7f026eee15cca358943b0546fe56fc09204f1dfe90e2614f99b9" +} diff --git a/.sqlx/query-77ad562b6d78115ebb726d58cf1e4de69df169c1872cb452488ff8c43ed983a9.json b/.sqlx/query-77ad562b6d78115ebb726d58cf1e4de69df169c1872cb452488ff8c43ed983a9.json new file mode 100644 index 0000000..15f7036 --- /dev/null +++ b/.sqlx/query-77ad562b6d78115ebb726d58cf1e4de69df169c1872cb452488ff8c43ed983a9.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n INSERT INTO calendarobjectchangelog (principal, cal_id, object_id, \"operation\", synctoken)\n VALUES (?1, ?2, ?3, ?4, (\n SELECT synctoken FROM calendars WHERE (principal, id) = (?1, ?2)\n ))", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "77ad562b6d78115ebb726d58cf1e4de69df169c1872cb452488ff8c43ed983a9" +} diff --git a/.sqlx/query-d0031fbbd6cf023e3f5ef8e6006723b7ff654b69699e4cbc8177941c9d414105.json b/.sqlx/query-d0031fbbd6cf023e3f5ef8e6006723b7ff654b69699e4cbc8177941c9d414105.json deleted file mode 100644 index 13fbdb7..0000000 --- a/.sqlx/query-d0031fbbd6cf023e3f5ef8e6006723b7ff654b69699e4cbc8177941c9d414105.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "SQLite", - "query": "\n INSERT INTO addressobjectchangelog (principal, addressbook_id, object_id, operation, synctoken)\n VALUES (?1, ?2, ?3, ?4, (\n SELECT synctoken FROM addressbooks WHERE (principal, id) = (?1, ?2)\n ))", - "describe": { - "columns": [], - "parameters": { - "Right": 4 - }, - "nullable": [] - }, - "hash": "d0031fbbd6cf023e3f5ef8e6006723b7ff654b69699e4cbc8177941c9d414105" -} diff --git a/.sqlx/query-dbdbcd1f295ab098820574329d9fd1ddb4ee4d40c5e1f476b23ccc23321c18e2.json b/.sqlx/query-dbdbcd1f295ab098820574329d9fd1ddb4ee4d40c5e1f476b23ccc23321c18e2.json deleted file mode 100644 index 0562047..0000000 --- a/.sqlx/query-dbdbcd1f295ab098820574329d9fd1ddb4ee4d40c5e1f476b23ccc23321c18e2.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "SQLite", - "query": "\n INSERT INTO calendarobjectchangelog (principal, cal_id, object_id, operation, synctoken)\n VALUES (?1, ?2, ?3, ?4, (\n SELECT synctoken FROM calendars WHERE (principal, id) = (?1, ?2)\n ))", - "describe": { - "columns": [], - "parameters": { - "Right": 4 - }, - "nullable": [] - }, - "hash": "dbdbcd1f295ab098820574329d9fd1ddb4ee4d40c5e1f476b23ccc23321c18e2" -} diff --git a/crates/store_sqlite/migrations/1_calendar.sql b/crates/store_sqlite/migrations/1_calendar.sql index c3ddfe7..4dd10eb 100644 --- a/crates/store_sqlite/migrations/1_calendar.sql +++ b/crates/store_sqlite/migrations/1_calendar.sql @@ -32,7 +32,7 @@ CREATE TABLE calendarobjectchangelog ( "operation" INTEGER NOT NULL, synctoken INTEGER DEFAULT 0 NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (principal, cal_id, created_at), + PRIMARY KEY (principal, cal_id, synctoken, created_at), FOREIGN KEY (principal, cal_id) REFERENCES calendars (principal, id) ON DELETE CASCADE ); diff --git a/crates/store_sqlite/migrations/2_addressbook.sql b/crates/store_sqlite/migrations/2_addressbook.sql index 44d2a19..dac0d97 100644 --- a/crates/store_sqlite/migrations/2_addressbook.sql +++ b/crates/store_sqlite/migrations/2_addressbook.sql @@ -27,7 +27,7 @@ CREATE TABLE addressobjectchangelog ( "operation" INTEGER NOT NULL, synctoken INTEGER DEFAULT 0 NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (principal, addressbook_id, created_at), + PRIMARY KEY (principal, addressbook_id, synctoken, created_at), FOREIGN KEY (principal, addressbook_id) REFERENCES addressbooks (principal, id) ON DELETE CASCADE );