feat(hub): add central service foundation and transactional mail

This commit is contained in:
Loki 2026-10-24 14:15:48 +02:00
parent b14f036bdb
commit a811de590a
Signed by: boba
GPG key ID: 253067914055423B
25 changed files with 1521 additions and 4 deletions

View file

@ -0,0 +1,26 @@
-- No authentication/registry endpoints use these tables yet. Defining durable
-- IDs now does not imply that account/device authorization is implemented.
CREATE TABLE hub_metadata (
key TEXT PRIMARY KEY,
value TEXT NOT NULL
);
CREATE TABLE accounts (
user_id TEXT PRIMARY KEY,
handle TEXT UNIQUE NOT NULL,
created_at INTEGER NOT NULL
);
CREATE TABLE devices (
device_id TEXT PRIMARY KEY,
user_id TEXT NOT NULL REFERENCES accounts(user_id) ON DELETE CASCADE,
public_key BLOB NOT NULL,
created_at INTEGER NOT NULL,
revoked_at INTEGER
);
CREATE TABLE servers (
server_id TEXT PRIMARY KEY,
owner_user_id TEXT NOT NULL REFERENCES accounts(user_id),
public_key BLOB UNIQUE NOT NULL,
address TEXT NOT NULL,
visibility TEXT NOT NULL CHECK (visibility IN ('private', 'unlisted', 'public')),
created_at INTEGER NOT NULL
);