CI / Rust (fmt / clippy / test / build) (push) Successful in 1m41s
CI / HTTP/JSON reference + SQLite persistence (push) Successful in 1m16s
CI / Rust (fmt / clippy / test / build) (pull_request) Successful in 47s
CI / HTTP/JSON reference + SQLite persistence (pull_request) Successful in 1m34s
The Go implementation is preserved in the v1.0.0 tag. Its observable behaviour stays the API reference: responses recorded from the Go server live in tools/compatibility_expected.txt, and tools/compatibility.py now compares the Rust server against them (--update re-records after an intentional change). The Go SQLite schema is frozen in tests/fixtures/go_schema_v1.sql for the existing-database test. Move the web client from internal/httpapi/web to web/, drop the Go CI job and Go version pin, and update README, AGENTS.md and docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.3 KiB
SQL
39 lines
1.3 KiB
SQL
-- SQLite schema created by the original Go server (v1.0.0, internal/database/database.go).
|
|
-- Rust must keep opening databases with exactly this schema; do not edit.
|
|
CREATE TABLE IF NOT EXISTS users (
|
|
id TEXT PRIMARY KEY,
|
|
email TEXT NOT NULL UNIQUE COLLATE NOCASE,
|
|
password_hash TEXT NOT NULL,
|
|
created_at TEXT NOT NULL
|
|
);
|
|
CREATE TABLE IF NOT EXISTS refresh_tokens (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
token_hash TEXT NOT NULL UNIQUE,
|
|
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
expires_at TEXT NOT NULL,
|
|
created_at TEXT NOT NULL,
|
|
revoked_at TEXT
|
|
);
|
|
CREATE INDEX IF NOT EXISTS refresh_tokens_user_idx ON refresh_tokens(user_id);
|
|
CREATE TABLE IF NOT EXISTS records (
|
|
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
entity TEXT NOT NULL,
|
|
record_id TEXT NOT NULL,
|
|
payload TEXT,
|
|
updated_at TEXT NOT NULL,
|
|
deleted INTEGER NOT NULL DEFAULT 0,
|
|
version INTEGER NOT NULL,
|
|
PRIMARY KEY (user_id, entity, record_id)
|
|
);
|
|
CREATE TABLE IF NOT EXISTS changes (
|
|
sequence INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
entity TEXT NOT NULL,
|
|
record_id TEXT NOT NULL,
|
|
payload TEXT,
|
|
updated_at TEXT NOT NULL,
|
|
deleted INTEGER NOT NULL,
|
|
version INTEGER NOT NULL
|
|
);
|
|
CREATE INDEX IF NOT EXISTS changes_user_sequence_idx ON changes(user_id, sequence);
|