powered by Jive Software

Improving Openfire's SQL schema

Hello,

I’m wondering if it would be possible to improve Openfire SQL schema on some points:

  • Increasing the size of some field, especially ‘username’ from varchar(64) to varchar(128) (or more)
  • Adding foreign keys for all fields that reference the same object (example given: foreign keys for all username fields)

What do you think of this ?

I’m not sure if we should add foreign keys, as that might break a lot of code (it shouldn’t, but it probably will). I see no issue with changing column definitions though! I’d welcome a pull request! :slight_smile:

1 Like

Ok sure, I will do the PR.

2 Likes

In my mind, the biggest issue would be having robust schema migration scripts that would gracefully handle people’s current openfire database. Since the current database does not enforce such foreign keys, adding them now may be painful. For example, would the upgrade script remove any user content from a given table if that user did not exist in the base user’s table? You also would have to support this for all openfire supported databases. This gets painful fast :slight_smile:

1 Like