Changeset 0.23.1 (#154)
This commit is contained in:
23
server/database/migrations/sqlite/016_v023_multiuser.sql
Normal file
23
server/database/migrations/sqlite/016_v023_multiuser.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
-- ==========================================
|
||||
-- Chat Switchboard — 006 Multi-User: DMs + Channels (SQLite)
|
||||
-- ==========================================
|
||||
-- SQLite does not support ALTER CONSTRAINT or DROP CONSTRAINT.
|
||||
-- The type check is enforced by application logic for SQLite.
|
||||
-- ==========================================
|
||||
|
||||
-- ── ai_mode ──────────────────────────────────────────────────────────
|
||||
-- SQLite ignores CHECK constraints on existing rows; we add the column
|
||||
-- and rely on app-layer validation for the enum values.
|
||||
ALTER TABLE channels ADD COLUMN ai_mode TEXT NOT NULL DEFAULT 'auto';
|
||||
|
||||
-- ── topic ─────────────────────────────────────────────────────────────
|
||||
ALTER TABLE channels ADD COLUMN topic TEXT;
|
||||
|
||||
-- ── Presence ──────────────────────────────────────────────────────────
|
||||
CREATE TABLE IF NOT EXISTS user_presence (
|
||||
user_id TEXT PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
|
||||
last_seen DATETIME NOT NULL DEFAULT (datetime('now')),
|
||||
status TEXT NOT NULL DEFAULT 'online'
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_user_presence_last_seen ON user_presence(last_seen DESC);
|
||||
Reference in New Issue
Block a user