~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/patch-2208-21-0.sql

  • Committer: Stuart Bishop
  • Date: 2010-10-05 18:27:44 UTC
  • mto: (7675.1202.1 bugsummary)
  • mto: This revision was merged to the branch mainline in revision 11695.
  • Revision ID: stuart.bishop@canonical.com-20101005182744-3bbtfiwsgn2v5k78
Drop foreign key constraint on lp_OpenIdIdentifier table - insertion order can cause it to break when it points to lp_Person, and lp_account is deprecated

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
SET client_min_messages=ERROR;
2
2
 
3
 
CREATE TABLE lp_OpenIdidentifier (
 
3
CREATE TABLE lp_OpenIdIdentifier (
4
4
    identifier text PRIMARY KEY,
5
 
    account    integer NOT NULL REFERENCES lp_person(account),
 
5
    account    integer NOT NULL,
6
6
    date_created timestamp without time zone NOT NULL);
7
7
 
8
8
INSERT INTO lp_OpenIdIdentifier (identifier, account, date_created)
9
9
SELECT identifier, account, date_created FROM OpenIdIdentifier
10
10
WHERE identifier NOT IN (SELECT identifier FROM lp_OpenIdIdentifier);
11
11
 
 
12
CREATE INDEX lp_openididentifier__account__idx
 
13
ON lp_OpenIdIdentifier(account);
12
14
 
13
15
INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 21, 0);