add invite system

This commit is contained in:
2025-08-11 17:26:15 +03:00
parent 1c80777fe4
commit 712782bc1c
10 changed files with 203 additions and 7 deletions

View File

@@ -90,6 +90,12 @@ SCHEMA = [
"key" TEXT NOT NULL UNIQUE
)""",
"""CREATE TABLE IF NOT EXISTS "invite_keys" (
"id" INTEGER NOT NULL PRIMARY KEY,
"created_by" REFERENCES users(id) ON DELETE CASCADE,
"key" TEXT NOT NULL UNIQUE
)""",
# INDEXES
"CREATE INDEX IF NOT EXISTS idx_post_history_post_id ON post_history(post_id)",
"CREATE INDEX IF NOT EXISTS idx_posts_thread ON posts(thread_id, created_at, id)",