migrations/postgres: add missing sequence counter for sqlite parity

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iaf993250bff02b3d02aece62876b5ee56a6a6964
This commit is contained in:
raf 2026-03-19 22:37:51 +03:00
commit a2d233ed6d
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -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_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
CREATE TABLE device_sync_state (
device_id TEXT NOT NULL REFERENCES sync_devices(id) ON DELETE CASCADE,