powered by Jive Software

Can we alter the embedded database of openfire?

Actully i want to modify the OFUSER table’s column “Name” in the database. i want to make it unique and not null. i try to alter it using dbaccess plugin and run this query

ALTER TABLE OFUSER MODIFY name varchar(100) not null;

but this gives me error:

class org.jivesoftware.openfire.plugin.dbaccess.db_002daccess_jsp: SQL Error: java.sql.SQLException: Unexpected token: MODIFY in statement [ALTER TABLE OFUSER MODIFY]

so my question is, is it possible to do so?

I strongly advice against making database modifications, especially when the database is actively being used by an Openfire instance. Not that we provide any warranty, but you’ll void it nonetheless.

That being said: if you are feeling adventurous: the embedded database used by Openfire is an instance of HSQLDB. You’ll find a lot of information on how to work with than database on http://hsqldb.org/

Thank you so much for the reply

Easiest way for this and similar changes: Shutdown Openfire, edit database/openfire.sql and start Openfire again.

Modifing data may be fine, modifing the DDL is not recommended.

Do you have an issue there that a username is null / improvment of DDL as name must never be null?

No i want “Name” field to be “not null”