| 1 | -- A workspace's managed workflows (src/managed.rs): workflows its owners |
| 2 | -- add to its repositories, each run in every repository it targets as that |
| 3 | -- repository's own, under the path `managed/<name>.yml`. `source` is a copy |
| 4 | -- of the workflow file it was added from, taken when it was saved, so only |
| 5 | -- an owner changes what runs. `mode` is `required` (a repository's workflow |
| 6 | -- of the same `name:` is set aside, and no repository turns it off) or |
| 7 | -- `default` (a repository's workflow of the same name runs in its place, |
| 8 | -- and its admins can turn it off). |
| 9 | CREATE TABLE IF NOT EXISTS workspace_managed_workflows ( |
| 10 | namespace TEXT NOT NULL, |
| 11 | name TEXT NOT NULL, |
| 12 | -- `owner/repo/path@ref`, as given. |
| 13 | source_ref TEXT NOT NULL, |
| 14 | source_repo_id TEXT NOT NULL, |
| 15 | source_sha TEXT, |
| 16 | source_private INTEGER NOT NULL DEFAULT 0, |
| 17 | source TEXT NOT NULL, |
| 18 | -- Its `name:`, as repositories list it. |
| 19 | workflow_name TEXT NOT NULL, |
| 20 | mode TEXT NOT NULL, |
| 21 | -- JSON: names and patterns; empty is every repository. |
| 22 | repositories TEXT NOT NULL DEFAULT '[]', |
| 23 | visibility TEXT NOT NULL DEFAULT 'all', |
| 24 | created_at TEXT NOT NULL, |
| 25 | updated_at TEXT NOT NULL, |
| 26 | updated_by TEXT NOT NULL, |
| 27 | PRIMARY KEY (namespace, name) |
| 28 | ); |