fix: SQLite boolean binding, CSS brace, race condition, 0 npm vulns, code-splitting
This commit is contained in:
@@ -105,3 +105,31 @@ CREATE INDEX IF NOT EXISTS idx_layers_drawing ON layers(drawing_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_elements_drawing ON elements(drawing_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_elements_layer ON elements(layer_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_blocks_drawing ON blocks(drawing_id);
|
||||
|
||||
-- ─── Notifications ───────────────────────────────────
|
||||
CREATE TABLE IF NOT EXISTS notifications (
|
||||
id TEXT PRIMARY KEY,
|
||||
user_id TEXT NOT NULL,
|
||||
type TEXT NOT NULL DEFAULT 'info',
|
||||
title TEXT NOT NULL,
|
||||
message TEXT NOT NULL,
|
||||
read INTEGER NOT NULL DEFAULT 0,
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
-- ─── Project Shares ──────────────────────────────────
|
||||
CREATE TABLE IF NOT EXISTS project_shares (
|
||||
id TEXT PRIMARY KEY,
|
||||
project_id TEXT NOT NULL,
|
||||
shared_with_email TEXT NOT NULL,
|
||||
shared_by TEXT NOT NULL,
|
||||
permission TEXT NOT NULL DEFAULT 'view' CHECK(permission IN ('view','edit','admin')),
|
||||
share_token TEXT UNIQUE,
|
||||
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
||||
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (shared_by) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_notifications_user ON notifications(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_shares_project ON project_shares(project_id);
|
||||
|
||||
Reference in New Issue
Block a user