| 1 | -- Admin dashboard: open sign-up invites (independent of a pre-created account) |
| 2 | -- and instance settings that override the config file. |
| 3 | CREATE TABLE signup_invites ( |
| 4 | id TEXT PRIMARY KEY, |
| 5 | token_hash TEXT NOT NULL, |
| 6 | note TEXT, |
| 7 | expires_at BIGINT, |
| 8 | used_at BIGINT, |
| 9 | used_by TEXT REFERENCES users(id) ON DELETE SET NULL, |
| 10 | created_by TEXT REFERENCES users(id) ON DELETE SET NULL, |
| 11 | created_at BIGINT NOT NULL |
| 12 | ); |
| 13 | CREATE UNIQUE INDEX idx_signup_invites_token ON signup_invites (token_hash); |
| 14 | |
| 15 | CREATE TABLE instance_settings ( |
| 16 | key TEXT PRIMARY KEY, |
| 17 | value TEXT NOT NULL |
| 18 | ); |