g1t/services/projects/migrations/0010_kind_and_links.sql
| 1 | -- What a project is and where it runs, set by a person, and its links |
| 2 | -- (services/projects/src/kind.ts, src/links.ts). |
| 3 | |
| 4 | -- app, library, tool, docs or other; null leaves it to detection. |
| 5 | ALTER TABLE projects ADD COLUMN kind_setting TEXT; |
| 6 | -- g1t (Deployments on g1t.page) or elsewhere; null leaves it to whether |
| 7 | -- Deployments are on. |
| 8 | ALTER TABLE projects ADD COLUMN runs_setting TEXT; |
| 9 | -- Production's address when it is deployed elsewhere. |
| 10 | ALTER TABLE projects ADD COLUMN production_url TEXT; |
| 11 | |
| 12 | -- Its own homepage; null follows `repo_website`, its repository's website, |
| 13 | -- kept from repos like its description. |
| 14 | ALTER TABLE projects ADD COLUMN homepage TEXT; |
| 15 | ALTER TABLE projects ADD COLUMN repo_website TEXT; |
| 16 | ALTER TABLE projects ADD COLUMN docs_url TEXT; |
| 17 | -- Its other links: a JSON list of {"label", "url"}, at most 10. |
| 18 | ALTER TABLE projects ADD COLUMN links TEXT; |
| 19 | |
| 20 | -- `deploys` (0007) is replaced by the two settings, keeping what each |
| 21 | -- project does: "Deploys" was an app deploying on g1t; "Doesn't deploy" |
| 22 | -- was a library (or a tool), which a person can now say more exactly. |
| 23 | -- Auto stays auto. The column stays, unread. |
| 24 | UPDATE projects SET kind_setting = 'app', runs_setting = 'g1t' WHERE deploys = 'yes'; |
| 25 | UPDATE projects SET kind_setting = 'library' WHERE deploys = 'no'; |
| 26 | |
| 27 | -- Every workspace's projects are read from repos once more, on their next |
| 28 | -- listing, so repo_website is the repository's website as it is now. |
| 29 | DELETE FROM backfilled; |