wildfire_postgresql.sql 2.91 KB
Newer Older
Gaston Dombiak's avatar
Gaston Dombiak committed
1 2 3
-- $Revision:  $
-- $Date:  $

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
-- Increase size of username field

ALTER TABLE jiveUser ADD COLUMN temp varchar(64);
UPDATE jiveUser SET temp = username;
ALTER TABLE jiveUser DROP CONSTRAINT jiveUser_pk;
ALTER TABLE jiveUser DROP COLUMN username;
ALTER TABLE jiveUser RENAME COLUMN temp to username;
ALTER TABLE jiveUser ALTER COLUMN "username" SET NOT NULL;
ALTER TABLE jiveUser ADD CONSTRAINT jiveUser_pk PRIMARY KEY (username);

ALTER TABLE jiveUserProp ADD COLUMN temp varchar(64);
UPDATE jiveUserProp SET temp = username;
ALTER TABLE jiveUserProp DROP CONSTRAINT jiveUserProp_pk;
ALTER TABLE jiveUserProp DROP COLUMN username;
ALTER TABLE jiveUserProp RENAME COLUMN temp to username;
ALTER TABLE jiveUserProp ALTER COLUMN "username" SET NOT NULL;
ALTER TABLE jiveUserProp ADD CONSTRAINT jiveUserProp_pk PRIMARY KEY (username, name);

ALTER TABLE jivePrivate ADD COLUMN temp varchar(64);
UPDATE jivePrivate SET temp = username;
ALTER TABLE jivePrivate DROP CONSTRAINT jivePrivate_pk;
ALTER TABLE jivePrivate DROP COLUMN username;
ALTER TABLE jivePrivate RENAME COLUMN temp to username;
ALTER TABLE jivePrivate ALTER COLUMN "username" SET NOT NULL;
ALTER TABLE jivePrivate ADD CONSTRAINT jivePrivate_pk PRIMARY KEY (username, name, namespace);


ALTER TABLE jiveOffline ADD COLUMN temp varchar(64);
UPDATE jiveOffline SET temp = username;
ALTER TABLE jiveOffline DROP CONSTRAINT jiveOffline_pk;
ALTER TABLE jiveOffline DROP COLUMN username;
ALTER TABLE jiveOffline RENAME COLUMN temp to username;
ALTER TABLE jiveOffline ALTER COLUMN "username" SET NOT NULL;
ALTER TABLE jiveOffline ADD CONSTRAINT jiveOffline_pk PRIMARY KEY (username, messageID);

ALTER TABLE jiveRoster ADD COLUMN temp varchar(64);
UPDATE jiveRoster SET temp = username;
DROP INDEX jiveRoster_username_idx;
ALTER TABLE jiveRoster DROP COLUMN username;
ALTER TABLE jiveRoster RENAME COLUMN temp to username;
ALTER TABLE jiveRoster ALTER COLUMN "username" SET NOT NULL;
CREATE INDEX jiveRoster_username_idx ON jiveRoster (username);

ALTER TABLE jiveVCard ADD COLUMN temp varchar(64);
UPDATE jiveVCard SET temp = username;
ALTER TABLE jiveVCard DROP CONSTRAINT jiveVCard_pk;
ALTER TABLE jiveVCard DROP COLUMN username;
ALTER TABLE jiveVCard RENAME COLUMN temp to username;
ALTER TABLE jiveVCard ALTER COLUMN "username" SET NOT NULL;
ALTER TABLE jiveVCard ADD CONSTRAINT jiveVCard_pk PRIMARY KEY (username);

ALTER TABLE jivePrivacyList ADD COLUMN temp varchar(64);
UPDATE jivePrivacyList SET temp = username;
ALTER TABLE jivePrivacyList DROP CONSTRAINT jivePrivacyList_pk;
DROP INDEX jivePList_default_idx;
ALTER TABLE jivePrivacyList DROP COLUMN username;
ALTER TABLE jivePrivacyList RENAME COLUMN temp to username;
ALTER TABLE jivePrivacyList ALTER COLUMN "username" SET NOT NULL;
ALTER TABLE jivePrivacyList ADD CONSTRAINT jivePrivacyList_pk PRIMARY KEY (username, name);
CREATE INDEX jivePList_default_idx ON jivePrivacyList (username, isDefault);

Gaston Dombiak's avatar
Gaston Dombiak committed
65
UPDATE jiveVersion set version=9 where name = 'wildfire';