Diff for "Code/MergeQueues/DBModels"

Not logged in - Log In / Register

Differences between revisions 3 and 7 (spanning 4 versions)
Revision 3 as of 2010-09-16 23:52:35
Size: 699
Editor: rockstar
Comment:
Revision 7 as of 2010-09-22 21:46:46
Size: 861
Editor: rockstar
Comment:
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. {{{
ALTER TABLE Branch
   DROP COLUMN merge_robot;
Line 5: Line 7:
Ideally, we only create 2 new database tables. They would look like this: ALTER TABLE Branch
   DROP COLUMN merge_control_status;
Line 7: Line 10:
branchmergequeue
  * id
  * registrant
  * owner
  * name
  * description
  * date_created
  * config
DROP TABLE BranchMergeRobot;
Line 16: Line 12:
branchqueue
  * id
  * branch
  * queue
Line 21: Line 13:
branchmergequeueitem
  * id
  * proposal
  * queue
  * queuer (? Is there a better name for this)
  * log (a reference to a librarian file of the log)
  * state (queued, started, completed, failed)
  * index (index in the queue)
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,
    configuration TEXT,
    date_created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
    CONSTRAINT owner_name UNIQUE (owner, name)
);

CREATE TABLE BranchQueue (
    branch integer NOT NULL REFERENCES Branch,
    queue integer NOT NULL REFERENCES BranchMergeQueue,
    CONSTRAINT branch_unique UNIQUE (branch)
    PRIMARY KEY (queue, branch)
);

ALTER TABLE Branch
   ADD COLUMN merge_queue_config TEXT;


}}}

Merge Queues Database Model

ALTER TABLE Branch
   DROP COLUMN merge_robot;

ALTER TABLE Branch
   DROP COLUMN merge_control_status;

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,
    configuration TEXT,
    date_created timestamp without time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
    CONSTRAINT owner_name UNIQUE (owner, name)
);

CREATE TABLE BranchQueue (
    branch integer NOT NULL REFERENCES Branch,
    queue integer NOT NULL REFERENCES BranchMergeQueue,
    CONSTRAINT branch_unique UNIQUE (branch)
    PRIMARY KEY (queue, branch)
);

ALTER TABLE Branch
   ADD COLUMN merge_queue_config TEXT;

Code/MergeQueues/DBModels (last edited 2010-09-22 21:46:46 by rockstar)