Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OF-2940: After database install, run database upgrade check #2679

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

guusdk
Copy link
Member

@guusdk guusdk commented Feb 11, 2025

With this change, any database upgrade scripts that update the database content beyond what is in the database install script will be executed directly after the install scripts are executed.

One side-effect of this approach is that under certain conditions, the 'success' message can be logged twice. I'm not bothered by that to much:

2025.02.11 20:56:20.914 INFO  [PluginMonitorExec-2]: org.jivesoftware.database.SchemaManager - Database update successful.
2025.02.11 20:56:20.914 INFO  [PluginMonitorExec-2]: org.jivesoftware.database.SchemaManager - Database update successful.

With this change, any database upgrade scripts that update the database content beyond what is in the database install script will be executed directly after the install scripts are executed.
@akrherz
Copy link
Member

akrherz commented Feb 11, 2025

Is there a scenario where this is possible?

@guusdk
Copy link
Member Author

guusdk commented Feb 11, 2025

Yes, quite easily. You can have a plugin that has an install script that creates a database structure for, let's say, version 5, while update scripts exist for versions 1 through 10.

We typically don't do this (we always make sure that our install script immediately creates 'the latest version' of the database structure) but I've seen third-party plugins that don't: those only have an initial install script, followed by multiple upgrade scripts. For those plugins, the plugin currently needs to be reloaded for the entire database upgrade to complete (until that's done, the installation reports success, but isn't actually using the latest version, which can get very confusing). With this change, that is no longer needed.

@Fishbowler
Copy link
Member

Have you been able to test this?

@guusdk
Copy link
Member Author

guusdk commented Feb 13, 2025

Have you been able to test this?

Not exhaustive, but I tested with a regular plugin and a plugin that had its install script install less then the upgrade scripts.

@guusdk guusdk merged commit 5aa197a into igniterealtime:main Feb 13, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants