Commit 566314d6 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Fixed HSQL upgrade errors.


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10800 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2f5f68e1
...@@ -16,12 +16,11 @@ CREATE TABLE mucServiceProp ( ...@@ -16,12 +16,11 @@ CREATE TABLE mucServiceProp (
); );
// add new indexed column to mucRoom // add new indexed column to mucRoom
ALTER TABLE mucRoom ADD COLUMN serviceID BIGINT NOT NULL BEFORE roomID; ALTER TABLE mucRoom ADD COLUMN serviceID BIGINT BEFORE roomID;
CREATE INDEX mucRoom_serviceid_idx ON mucRoom(serviceID); CREATE INDEX mucRoom_serviceid_idx ON mucRoom(serviceID);
// change mucRoom primary key to be referenced around serviceID // change mucRoom primary key to be referenced around serviceID
ALTER TABLE mucRoom DROP CONSTRAINT mucRoom_pk; ALTER TABLE mucRoom DROP CONSTRAINT mucRoom_pk;
ALTER TABLE mucRoom ADD CONSTRAINT mucRoom_pk PRIMARY KEY (serviceID, name);
// add default entry for conference service and associated jiveID value // add default entry for conference service and associated jiveID value
INSERT INTO mucService (serviceID, subdomain) VALUES (1, 'conference'); INSERT INTO mucService (serviceID, subdomain) VALUES (1, 'conference');
...@@ -30,6 +29,9 @@ INSERT INTO jiveID (idType, id) VALUES (26, 1); ...@@ -30,6 +29,9 @@ INSERT INTO jiveID (idType, id) VALUES (26, 1);
// update all entries in mucRoom to be set to the default conference service // update all entries in mucRoom to be set to the default conference service
UPDATE mucRoom set serviceID = 1; UPDATE mucRoom set serviceID = 1;
// finish changing mucRoom primary key to be referenced around serviceID
ALTER TABLE mucRoom ADD CONSTRAINT mucRoom_pk PRIMARY KEY (serviceID, name);
// update conference name/desc if there is a custom one set // update conference name/desc if there is a custom one set
UPDATE mucService SET mucService.subdomain = ( SELECT jiveProperty.propValue FROM jiveProperty WHERE jiveProperty.name = 'xmpp.muc.service' ) UPDATE mucService SET mucService.subdomain = ( SELECT jiveProperty.propValue FROM jiveProperty WHERE jiveProperty.name = 'xmpp.muc.service' )
WHERE EXISTS ( SELECT jiveProperty.propValue FROM jiveProperty WHERE jiveProperty.name = 'xmpp.muc.service' ); WHERE EXISTS ( SELECT jiveProperty.propValue FROM jiveProperty WHERE jiveProperty.name = 'xmpp.muc.service' );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment