When installing my plugin, the first time Openfire loads my plugin only the version 0 of the sql scripts get executed. In the Openfire console I see the message “Missing database schema for plugin23. Attempting to install… Database update successful.”
Once Openfire is restarted I get the following message in the Openfire console “Found old database schema for plugin23. Upgrading to version 1… Database update successful.” After that everything seems to work fine. I’m just trying to avoid people having to restart openfire to get my plugin to work correctly.
Here is my Plugin directory structure:
Plugin23 Root ( resides in Openfire\Plugins)
¦
±–database (contains plugin23_hsqldb.sql)
¦ ±–upgrade
¦ ±–1 (contains plugin23_hsqldb.sql)
¦
±–lib
¦
±–web
±–WEB-INF
My Plugin.xml contains:
1
And here are the sql scripts:
Version 0
CREATE CACHED TABLE Action (
identifier VARCHAR(200) NOT NULL,
name VARCHAR(200),
description VARCHAR(200),
CONSTRAINT Action_pk PRIMARY KEY (roomID)
);
INSERT INTO jiveVersion (name, version) VALUES (‘plugin23’, 0);
Version 1
CREATE CACHED TABLE chat23(
identifier VARCHAR(200) NOT NULL,
roomID VARCHAR(200) NOT NULL,
XMLblob LONGVARCHAR NOT NULL,
type VARCHAR(200) NOT NULL,
CONSTRAINT chat23_pk PRIMARY KEY (identifier)
);
// Finally, insert default table values.
UPDATE jiveVersion set version=‘1’ where name=‘plugin23’;
Thanks in advance for any help,
Chris