feat: dashboard 3-column layout — project folders treeview, project cards with open button, info panel
This commit is contained in:
@@ -99,6 +99,25 @@ CREATE TABLE IF NOT EXISTS settings (
|
||||
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
-- ─── Project Folders ───────────────────────────────────
|
||||
CREATE TABLE IF NOT EXISTS project_folders (
|
||||
id TEXT PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
parent_id TEXT,
|
||||
owner_id TEXT NOT NULL,
|
||||
created_at TEXT DEFAULT (datetime('now')),
|
||||
FOREIGN KEY (parent_id) REFERENCES project_folders(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_project_folders_parent ON project_folders(parent_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_project_folders_owner ON project_folders(owner_id);
|
||||
|
||||
-- ─── Projects: add folder_id column ─────────────────────
|
||||
-- NOTE: ALTER TABLE is idempotent-safe via try/catch in adapter; schema.sql
|
||||
-- is only exec'd on fresh databases. For existing DBs, the adapter runs
|
||||
-- the ALTER in init().
|
||||
|
||||
-- ─── Indexes ────────────────────────────────────────
|
||||
CREATE INDEX IF NOT EXISTS idx_drawings_project ON drawings(project_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_layers_drawing ON layers(drawing_id);
|
||||
|
||||
Reference in New Issue
Block a user