{ "format_version": 1, "id": "album_item", "name": "Picture", "plural": "Pictures", "builtin": true, "visibility": "owner", "columns": [ { "key": "album_id", "name": "Album", "type": "link", "link_to": "album", "required": true, "readonly": true }, { "key": "record_kind", "type": "text", "readonly": true }, { "key": "record_id", "name": "Picture", "type": "text", "readonly": true }, { "key": "added_by", "type": "text", "readonly": true }, { "key": "sort_at", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "origin_handle", "type": "text", "readonly": true }, { "key": "kind", "name": "Kind", "type": "choice", "choices": [ "photo", "video" ], "readonly": true, "labels": { "photo": "Photo", "video": "Video" } }, { "key": "key", "name": "Print", "type": "photo", "readonly": true }, { "key": "caption", "name": "Caption", "type": "text", "readonly": true }, { "key": "taken_at", "name": "Taken", "type": "date", "readonly": true }, { "key": "duration_ms", "name": "Length", "type": "number", "readonly": true, "format": "duration_ms" } ], "instructions": "One picture or film in one album (kind names its table, record_id its id). Removing one takes it out of the album; the picture stays in Photos.", "tables": [ { "name": "cotton_media_album_items", "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": "album_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n album_id TEXT NOT NULL", "position": 2 }, { "name": "record_kind", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n record_kind TEXT NOT NULL", "position": 3 }, { "name": "record_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n record_id TEXT NOT NULL", "position": 4 }, { "name": "added_by", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n added_by TEXT NOT NULL", "position": 5 }, { "name": "sort_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n sort_at TEXT NOT NULL", "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": "origin_handle", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": " origin_handle TEXT CHECK (origin_handle IS NULL OR length(origin_handle) > 0)", "position": 10 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 11 } ], "constraints": [ { "declaration": "\n CHECK (record_kind IN ('photo', 'video'))", "position": 12 }, { "declaration": "\n CHECK (substr(record_id, 1, length(record_kind) + 1) = record_kind || ':')", "position": 13 }, { "declaration": "\n CHECK (added_by IN ('derived', 'user'))", "position": 14 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE", "position": 15 }, { "declaration": "\n FOREIGN KEY (album_id) REFERENCES cotton_media_albums(id)\n ", "position": 16 } ], "prefix": "CREATE TABLE cotton_media_album_items (", "suffix": ")", "indexes": [ "CREATE UNIQUE INDEX uq_cotton_media_album_items_member ON cotton_media_album_items (album_id, record_id)", "CREATE INDEX idx_cotton_media_album_items_record ON cotton_media_album_items (workspace_id, record_id)", "CREATE INDEX idx_cotton_media_album_items_origin ON cotton_media_album_items (origin_handle) WHERE origin_handle IS NOT NULL", "CREATE INDEX IF NOT EXISTS idx_cotton_media_album_items_author ON cotton_media_album_items (substr(_hlc, 20), _hlc)" ], "full_text": [], "triggers": [] } ], "picture": null, "engine": "media", "title": "caption", "date": "taken_at", "project": null, "order": null, "slip": { "title": "caption", "subtitle": null, "trailing": "taken_at", "photo": "key", "toggle": null, "badge": { "column": "kind", "symbol": "play.fill", "spoken": "Video", "values": [ "video" ] } }, "tile": { "face": "polaroid-grid" }, "page": [ { "heading": null, "columns": [ "key", "caption", "taken_at" ] } ], "layout": "sheet", "grid": { "columns": 4 }, "empty": { "title": "No pictures in this album", "message": "Add some from your photos with the + circle." }, "delete_when": { "column": "kind", "present": true }, "opens": { "column": "record_id", "table_column": "kind" }, "polaroid": { "caption": "duration_ms" }, "select": { "verb": "delete" }, "deletion": { "confirm": "Remove from album", "label": "Remove from album", "asks": false }, "parts": { "shape": "sheet", "head": { "facts": [] }, "links": [], "lists": [], "acts": { "more": [] }, "cards": [ { "column": "taken_at" }, { "column": "duration_ms" } ] }, "card": { "face": "plain", "fields": [ { "slot": "photo", "column": "key" }, { "slot": "title", "column": "caption" }, { "slot": "facts", "column": "kind", "also": [ "taken_at" ] } ] } }