migrations/postgres: add missing sequence counter for sqlite parity
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Iaf993250bff02b3d02aece62876b5ee56a6a6964
This commit is contained in:
parent
f831e58723
commit
a2d233ed6d
1 changed files with 7 additions and 0 deletions
|
|
@ -39,6 +39,13 @@ CREATE INDEX idx_sync_log_sequence ON sync_log(sequence);
|
||||||
CREATE INDEX idx_sync_log_path ON sync_log(path);
|
CREATE INDEX idx_sync_log_path ON sync_log(path);
|
||||||
CREATE INDEX idx_sync_log_timestamp ON sync_log(timestamp);
|
CREATE INDEX idx_sync_log_timestamp ON sync_log(timestamp);
|
||||||
|
|
||||||
|
-- Sequence counter for sync log
|
||||||
|
CREATE TABLE sync_sequence (
|
||||||
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
||||||
|
current_value BIGINT NOT NULL DEFAULT 0
|
||||||
|
);
|
||||||
|
INSERT INTO sync_sequence (id, current_value) VALUES (1, 0);
|
||||||
|
|
||||||
-- Device sync state - tracks sync status per device per file
|
-- Device sync state - tracks sync status per device per file
|
||||||
CREATE TABLE device_sync_state (
|
CREATE TABLE device_sync_state (
|
||||||
device_id TEXT NOT NULL REFERENCES sync_devices(id) ON DELETE CASCADE,
|
device_id TEXT NOT NULL REFERENCES sync_devices(id) ON DELETE CASCADE,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue