feat(hub): add central service foundation and transactional mail
This commit is contained in:
parent
b14f036bdb
commit
a811de590a
25 changed files with 1521 additions and 4 deletions
26
hub/migrations/0001_foundation.sql
Normal file
26
hub/migrations/0001_foundation.sql
Normal 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
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue