Builds: add a nullable jobset_id foreign key to Jobsets.

Also, adds an explicitly named "builds" accessor to the Jobsets
Schema object, which uses the project/jobset name.
This commit is contained in:
Graham Christensen
2020-02-05 15:11:56 -05:00
parent 624f1d8d2d
commit ddf00fa627
4 changed files with 80 additions and 6 deletions

10
src/sql/upgrade-61.sql Normal file
View File

@@ -0,0 +1,10 @@
-- Add the jobset_id columns to the Builds table. This will go
-- quickly, since the field is nullable. Note this is just part one of
-- this migration. Future steps involve a piecemeal backfilling, and
-- then making the column non-null.
ALTER TABLE Builds
ADD COLUMN jobset_id integer NULL,
ADD FOREIGN KEY (jobset_id)
REFERENCES Jobsets(id)
ON DELETE CASCADE;