218 lines · 6.3 KB · JSONRaw
{ "format_version": 1, "id": "decision", "name": "Decision", "plural": "Decisions", "picture": null, "builtin": true, "delete": false, "engine": "decisions", "columns": [ { "key": "title", "type": "text", "required": true }, { "key": "why", "type": "longtext" }, { "key": "pull", "name": "Pull request", "type": "text" }, { "key": "decided_by", "name": "Decided by", "type": "text", "readonly": true }, { "key": "created_at", "name": "Decided", "type": "date", "readonly": true }, { "key": "trashed_at", "name": "Binned", "type": "date", "readonly": true } ], "title": "title", "date": "created_at", "project": null, "order": null, "slip": { "title": "title", "subtitle": null, "trailing": null, "photo": null, "toggle": null }, "tile": { "face": "slip-list" }, "page": [ { "heading": null, "columns": [ "title", "why" ] }, { "heading": "Details", "columns": [ "decided_by", "pull", "created_at" ] } ], "instructions": "A decision records one choice made about a project and why it was made, with the pull request that carried it when there is one. Write it in one sentence as it was decided and keep the reasons in why; record only decisions the owner or the work actually made.", "add": false, "tables": [ { "name": "cotton_decisions", "columns": [ { "name": "id", "type": "TEXT", "default": null, "nullable": true, "primary_key": true, "declaration": "\n id TEXT PRIMARY KEY", "position": 0 }, { "name": "workspace_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n workspace_id TEXT NOT NULL", "position": 1 }, { "name": "title", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n title TEXT NOT NULL", "position": 2 }, { "name": "why", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n why TEXT", "position": 3 }, { "name": "pull", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n pull TEXT", "position": 4 }, { "name": "decided_by", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n decided_by TEXT", "position": 5 }, { "name": "trashed_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n trashed_at TEXT", "position": 6 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 7 }, { "name": "updated_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n updated_at TEXT NOT NULL", "position": 8 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 9 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 10 } ], "constraints": [ { "declaration": "\n CHECK (length(trim(title)) > 0)", "position": 11 }, { "declaration": "\n CHECK (length(title) <= 280)", "position": 12 }, { "declaration": "\n CHECK (pull IS NULL OR length(trim(pull)) > 0)", "position": 13 }, { "declaration": "\n CHECK (decided_by IS NULL OR length(trim(decided_by)) > 0)", "position": 14 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 15 } ], "prefix": "CREATE TABLE IF NOT EXISTS cotton_decisions (", "suffix": ")", "indexes": [ "CREATE INDEX IF NOT EXISTS idx_cotton_decisions_author ON cotton_decisions (substr(_hlc, 20), _hlc)" ], "full_text": [ "CREATE VIRTUAL TABLE fts_decisions USING fts5(\n title, why, content = 'cotton_decisions', content_rowid = 'rowid',\n tokenize = 'unicode61 remove_diacritics 2'\n )" ], "triggers": [ "CREATE TRIGGER fts_decisions_ai AFTER INSERT ON cotton_decisions WHEN new.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_decisions'), 0) BEGIN\n INSERT INTO fts_decisions (rowid, title, why) VALUES (new.rowid, new.title, new.why);\n END", "CREATE TRIGGER fts_decisions_ad AFTER DELETE ON cotton_decisions WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_decisions'), 0) BEGIN\n INSERT INTO fts_decisions (fts_decisions, rowid, title, why) VALUES ('delete', old.rowid, old.title, old.why);\n END", "CREATE TRIGGER fts_decisions_au AFTER UPDATE OF title, why ON cotton_decisions\n FOR EACH ROW WHEN old.rowid >= coalesce((SELECT floor FROM _fts_fill WHERE fts = 'fts_decisions'), 0) AND (new.title IS NOT old.title OR new.why IS NOT old.why) BEGIN\n INSERT INTO fts_decisions (fts_decisions, rowid, title, why) VALUES ('delete', old.rowid, old.title, old.why);\n INSERT INTO fts_decisions (rowid, title, why) VALUES (new.rowid, new.title, new.why);\n END" ] } ]}