Skip to content

g1t/services/projects/migrations/0010_kind_and_links.sql

29 lines1,452 bytesCodeBlame
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.
5ALTER TABLE projects ADD COLUMN kind_setting TEXT;
6-- g1t (Deployments on g1t.page) or elsewhere; null leaves it to whether
7-- Deployments are on.
8ALTER TABLE projects ADD COLUMN runs_setting TEXT;
9-- Production's address when it is deployed elsewhere.
10ALTER 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.
14ALTER TABLE projects ADD COLUMN homepage TEXT;
15ALTER TABLE projects ADD COLUMN repo_website TEXT;
16ALTER TABLE projects ADD COLUMN docs_url TEXT;
17-- Its other links: a JSON list of {"label", "url"}, at most 10.
18ALTER 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.
24UPDATE projects SET kind_setting = 'app', runs_setting = 'g1t' WHERE deploys = 'yes';
25UPDATE 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.
29DELETE FROM backfilled;