Initial kosync-rs port
This commit is contained in:
19
migrations/001_init.sql
Normal file
19
migrations/001_init.sql
Normal 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);
|
||||
Reference in New Issue
Block a user