470
Comment:
|
786
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
First, the `branchmergerobot` table needs to be deleted, because it'll be easier to just reproduce the table. Any data in there shouldn't have been in there anyway, so it can be deleted. | |
Line 5: | Line 4: |
Ideally, we only create 2 new database tables. They would look like this: branchmergequeue * id * registrant * owner * name * description * date_created branch * config branchqueue * id * branch * queue |
DROP TABLE `BranchMergeRobot`; CREATE TABLE `BranchMergeQueue` ( id serial NOT NULL PRIMARY KEY, registrant integer NOT NULL REFERENCES Person, owner integer NOT NULL REFERENCES Person, name text NOT NULL, description TEXT, date_created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL); ALTER TABLE `BranchQueue` ADD CONSTRAINT mergeowner_unique UNIQUE (owner, name); CREATE TABLE `BranchQueue` ( id serial NOT NULL PRIMARY KEY, branch integer NOT NULL REFERENCES Branch, queue integer NOT NULL REFERENCES BranchMergeQueue); ALTER TABLE `BranchQueue` ADD CONSTRAINT branchqueue_unique UNIQUE (branch, queue); ALTER TABLE `branch` ADD COLUMN `merge_queue_config` TEXT; |
Merge Queues Database Model
DROP TABLE BranchMergeRobot; CREATE TABLE BranchMergeQueue (
- id serial NOT NULL PRIMARY KEY, registrant integer NOT NULL REFERENCES Person, owner integer NOT NULL REFERENCES Person, name text NOT NULL, description TEXT, date_created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL);
ALTER TABLE BranchQueue ADD CONSTRAINT mergeowner_unique UNIQUE (owner, name); CREATE TABLE BranchQueue (
- id serial NOT NULL PRIMARY KEY, branch integer NOT NULL REFERENCES Branch,
queue integer NOT NULL REFERENCES BranchMergeQueue);
ALTER TABLE BranchQueue ADD CONSTRAINT branchqueue_unique UNIQUE (branch, queue); ALTER TABLE branch
ADD COLUMN merge_queue_config TEXT;