Initial kosync-rs port

This commit is contained in:
Codex
2026-06-12 09:42:23 +00:00
commit 52cec7f8f4
20 changed files with 4827 additions and 0 deletions

19
migrations/001_init.sql Normal file
View File

@@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS users (
username TEXT PRIMARY KEY NOT NULL,
key TEXT NOT NULL,
created_at INTEGER NOT NULL DEFAULT (unixepoch())
);
CREATE TABLE IF NOT EXISTS progress (
username TEXT NOT NULL,
document TEXT NOT NULL,
percentage REAL,
progress TEXT,
device TEXT,
device_id TEXT,
timestamp INTEGER,
PRIMARY KEY (username, document),
FOREIGN KEY (username) REFERENCES users(username) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_progress_username ON progress(username);