From 8023dc606b02df8d2b60817719fb57bfa98b2baf Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 19 Mar 2026 22:37:51 +0300 Subject: [PATCH] migrations/postgres: add missing sequence counter for sqlite parity Signed-off-by: NotAShelf Change-Id: Iaf993250bff02b3d02aece62876b5ee56a6a6964 --- migrations/postgres/V16__sync_system.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/migrations/postgres/V16__sync_system.sql b/migrations/postgres/V16__sync_system.sql index 5a54b7a..8a87823 100644 --- a/migrations/postgres/V16__sync_system.sql +++ b/migrations/postgres/V16__sync_system.sql @@ -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,