~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/patch-87-31-0.sql

  • Committer: Curtis Hovey
  • Date: 2007-07-14 15:58:21 UTC
  • mfrom: (4557 launchpad)
  • mto: This revision was merged to the branch mainline in revision 4603.
  • Revision ID: curtis.hovey@canonical.com-20070714155821-t7fb1onic9tfjs8n
Merge from RF. Resolved conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Adds the explicit branch type to the branch table.
 
3
 */
 
4
 
 
5
SET client_min_messages=ERROR;
 
6
 
 
7
ALTER TABLE Branch ADD COLUMN branch_type INT;
 
8
 
 
9
UPDATE Branch
 
10
SET branch_type = 3 -- IMPORTED
 
11
WHERE owner IN (
 
12
   SELECT id FROM Person
 
13
   WHERE name = 'vcs-imports');
 
14
 
 
15
UPDATE Branch
 
16
SET branch_type = 2 -- MIRRORED
 
17
WHERE url IS NOT NULL
 
18
  AND branch_type IS NULL;
 
19
 
 
20
UPDATE Branch
 
21
SET branch_type = 1 -- HOSTED
 
22
WHERE branch_type IS NULL;
 
23
 
 
24
ALTER TABLE Branch ALTER branch_type SET DEFAULT 0;
 
25
ALTER TABLE Branch ALTER branch_type SET NOT NULL;
 
26
 
 
27
ALTER TABLE Branch
 
28
ADD CONSTRAINT branch_type_url_consistent
 
29
CHECK ((branch_type = 2 AND url IS NOT NULL) OR url IS NULL);
 
30
 
 
31
INSERT INTO LaunchpadDatabaseRevision VALUES (87, 31, 0);