~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/archive/patch-67-17-0.sql

merge db-devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
SET client_min_messages=ERROR;
2
 
 
3
 
/*
4
 
 * Rename ProductSeries.branch to import_branch, and add a new user_branch
5
 
 * field.
6
 
 */
7
 
 
8
 
ALTER TABLE ProductSeries
9
 
  RENAME COLUMN branch TO import_branch;
10
 
ALTER TABLE ProductSeries
11
 
  ADD COLUMN user_branch integer;
12
 
 
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;
22
 
 
23
 
/*
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.
27
 
 */
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;
33
 
 
34
 
INSERT INTO LaunchpadDatabaseRevision VALUES (67, 17, 0);
35