1
SET client_min_messages=ERROR;
4
* Rename ProductSeries.branch to import_branch, and add a new user_branch
8
ALTER TABLE ProductSeries
9
RENAME COLUMN branch TO import_branch;
10
ALTER TABLE ProductSeries
11
ADD COLUMN user_branch integer;
13
/* Split the productseries_branch_fk constraint */
14
ALTER TABLE ProductSeries
15
ADD CONSTRAINT productseries__import_branch__fk
16
FOREIGN KEY (import_branch) REFERENCES Branch(id);
17
ALTER TABLE ProductSeries
18
ADD CONSTRAINT productseries__user_branch__fk
19
FOREIGN KEY (user_branch) REFERENCES Branch(id);
20
ALTER TABLE ProductSeries
21
DROP CONSTRAINT productseries_branch_fk;
24
* Rename the productseries_branch_key constraint.
25
* The uniqueness constraint is only required for importd's work, so
26
* we don't have an equivalent user_branch one.
28
ALTER TABLE ProductSeries
29
ADD CONSTRAINT productseries__import_branch__key
30
UNIQUE (import_branch);
31
ALTER TABLE ProductSeries
32
DROP CONSTRAINT productseries_branch_key;
34
INSERT INTO LaunchpadDatabaseRevision VALUES (67, 17, 0);