mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 17:12:22 +00:00
Add basic sync-token implementation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
CREATE TABLE calendars (
|
||||
principal TEXT NOT NULL,
|
||||
id TEXT NOT NULL,
|
||||
synctoken INTEGER DEFAULT 0 NOT NULL,
|
||||
displayname TEXT,
|
||||
description TEXT,
|
||||
'order' INT DEFAULT 0 NOT NULL,
|
||||
@@ -21,3 +22,15 @@ CREATE TABLE events (
|
||||
FOREIGN KEY (principal, cid) REFERENCES calendars(principal, id)
|
||||
);
|
||||
|
||||
CREATE TABLE eventchangelog (
|
||||
-- The actual sync token is the SQLite field 'ROWID'
|
||||
principal TEXT NOT NULL,
|
||||
cid TEXT NOT NULL,
|
||||
uid TEXT NOT NULL,
|
||||
operation INTEGER NOT NULL,
|
||||
synctoken INTEGER DEFAULT 0 NOT NULL,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (principal, cid, created_at),
|
||||
FOREIGN KEY (principal, cid) REFERENCES calendars(principal, id) ON DELETE CASCADE
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user