Cotton code
274 lines · 6.4 KB · JSONRaw
{  "format_version": 1,  "id": "todo_recurrence",  "name": "Repeating todo",  "plural": "Repeating todos",  "picture": null,  "builtin": true,  "delete": false,  "engine": "todos",  "columns": [    {      "key": "title",      "type": "text",      "required": true    },    {      "key": "notes",      "type": "longtext"    },    {      "key": "priority",      "type": "number"    },    {  "key": "rrule",  "name": "Repeats",  "type": "text",  "format": "repeat-rule",  "required": true,  "labels": {    "none": "Once",    "daily": "Daily",    "weekdays": "Every weekday",    "weekly": "Weekly",    "biweekly": "Every two weeks",    "monthly": "Monthly",    "yearly": "Yearly",    "custom": "Custom repeat"  }},    {      "key": "dtstart",      "name": "Starts",      "type": "date",      "required": true    },    {      "key": "paused",      "name": "Paused",      "type": "bool"    }  ],  "title": "title",  "date": "dtstart",  "project": null,  "order": null,  "slip": {    "title": "title",    "subtitle": "rrule",    "trailing": "dtstart",    "photo": null,    "toggle": null  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "title",        "rrule",        "dtstart",        "paused"      ]    },    {      "heading": "Details",      "columns": [        "notes",        "priority"      ]    }  ],  "instructions": "A repeating todo is the rule behind a series of todos: an iCal repeat rule and the moment the series starts. The todos themselves are created from it one occurrence at a time, so edit the rule to change future ones and pause it to stop new ones without losing the series.",  "add": false,  "parts": {  "shape": "sheet",  "head": {    "facts": []  },  "links": [],  "lists": [],  "acts": {    "more": []  },  "cards": [    {      "column": "rrule",      "object": "ring",      "label": "repeats"    },    {      "column": "dtstart",      "label": "starts"    },    {      "column": "paused"    },    {      "column": "notes",      "row": true    }  ],  "strip": []},  "tables": [    {      "name": "cotton_todo_recurrences",      "columns": [        {          "name": "id",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": true,          "declaration": "\n    id TEXT PRIMARY KEY",          "position": 0        },        {          "name": "title",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    title TEXT NOT NULL",          "position": 1        },        {          "name": "notes",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    notes TEXT",          "position": 2        },        {          "name": "priority",          "type": "INTEGER",          "default": "0",          "nullable": false,          "primary_key": false,          "declaration": "\n    priority INTEGER NOT NULL DEFAULT 0",          "position": 3        },        {          "name": "rrule",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    rrule TEXT NOT NULL",          "position": 4        },        {          "name": "dtstart",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    dtstart TEXT NOT NULL",          "position": 5        },        {          "name": "paused",          "type": "INTEGER",          "default": "0",          "nullable": false,          "primary_key": false,          "declaration": "\n    paused INTEGER NOT NULL DEFAULT 0",          "position": 6        },        {          "name": "materialized_until",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    materialized_until TEXT",          "position": 7        },        {          "name": "source_inbox_id",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    source_inbox_id TEXT",          "position": 8        },        {          "name": "created_at",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    created_at TEXT NOT NULL",          "position": 9        },        {          "name": "updated_at",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    updated_at TEXT NOT NULL",          "position": 10        },        {          "name": "workspace_id",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    workspace_id TEXT NOT NULL",          "position": 11        },        {          "name": "_hlc",          "type": "TEXT",          "default": "''",          "nullable": false,          "primary_key": false,          "declaration": "\n    _hlc TEXT NOT NULL DEFAULT ''",          "position": 12        },        {          "name": "_born",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    _born TEXT",          "position": 13        },        {          "name": "trashed_at",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": " trashed_at TEXT",          "position": 14        }      ],      "constraints": [        {          "declaration": "\n    FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n  ",          "position": 15        }      ],      "prefix": "CREATE TABLE cotton_todo_recurrences (",      "suffix": ")",      "indexes": [        "CREATE INDEX idx_cotton_todo_recurrences_workspace ON cotton_todo_recurrences (workspace_id)",        "CREATE INDEX IF NOT EXISTS idx_cotton_todo_recurrences_author ON cotton_todo_recurrences (substr(_hlc, 20), _hlc)"      ],      "full_text": [],      "triggers": []    }  ]}