This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/server/database/migrations/sqlite/005_notifications.sql
Jeffrey Smith 0003e66e43
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m40s
CI/CD / test-sqlite (pull_request) Successful in 2m45s
CI/CD / build-and-deploy (pull_request) Successful in 25s
rebrand: sweep remaining switchboard refs + rename cookies/storage keys
- CSS headers (4 files): Switchboard Core → Armature
- Editor .mjs headers (8 files): Chat Switchboard → Armature
- SQL migration comments + seed data (20 files): Switchboard Core → Armature
- Webhook header: X-Switchboard-Event → X-Armature-Event
- Cookie: sb_token → arm_token (3 Go files + auth.js)
- localStorage: sb_auth → arm_auth (auth.js + 2 test runners)
- localStorage: switchboard_theme → armature_theme (theme.js + base.html)
- Debug engine filter: chatSwitchboard/switchboard/sb_ → armatureChat/armature/arm_
- JS export: switchboardTheme → armatureTheme (theme.mjs + code-editor.mjs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:11:38 +00:00

32 lines
1.1 KiB
SQL

-- ==========================================
-- Armature — 005 Notifications (SQLite)
-- ==========================================
CREATE TABLE IF NOT EXISTS notifications (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
type TEXT NOT NULL,
title TEXT NOT NULL,
body TEXT DEFAULT '',
resource_type TEXT,
resource_id TEXT,
is_read INTEGER DEFAULT 0,
created_at TEXT DEFAULT (datetime('now'))
);
CREATE INDEX IF NOT EXISTS idx_notifications_user_unread
ON notifications(user_id, is_read, created_at);
CREATE INDEX IF NOT EXISTS idx_notifications_user_created
ON notifications(user_id, created_at);
CREATE TABLE IF NOT EXISTS notification_preferences (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
type TEXT NOT NULL,
in_app INTEGER NOT NULL DEFAULT 1,
email INTEGER NOT NULL DEFAULT 0,
UNIQUE(user_id, type)
);
CREATE INDEX IF NOT EXISTS idx_notification_prefs_user ON notification_preferences(user_id);