Einladungscodes: registration_mode open|invite|closed, Admin-API /api/invites, App mit Code-Feld und Code-Verwaltung; v0.3.2
This commit is contained in:
parent
d2658de099
commit
cf5e0b1ca7
38 changed files with 665 additions and 25 deletions
|
|
@ -63,6 +63,14 @@ CREATE TABLE IF NOT EXISTS auth_tokens(
|
|||
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
created_at INTEGER NOT NULL, expires_at INTEGER NOT NULL);
|
||||
CREATE INDEX IF NOT EXISTS idx_auth_tokens_user ON auth_tokens(user_id);
|
||||
CREATE TABLE IF NOT EXISTS invites(
|
||||
code TEXT PRIMARY KEY, max_uses INTEGER NOT NULL DEFAULT 1, uses INTEGER NOT NULL DEFAULT 0,
|
||||
expires_at INTEGER NOT NULL DEFAULT 0, created_at INTEGER NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS invite_uses(
|
||||
code TEXT NOT NULL REFERENCES invites(code) ON DELETE CASCADE,
|
||||
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
username TEXT NOT NULL, used_at INTEGER NOT NULL);
|
||||
CREATE INDEX IF NOT EXISTS idx_invite_uses_code ON invite_uses(code);
|
||||
`
|
||||
|
||||
// migrations add columns to databases created by older versions.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue