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

Allow customization for db migration #1061

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

ZakarFin
Copy link
Member

@ZakarFin ZakarFin commented Apr 23, 2024

Moved fi.nls.oskari.servlet.WebappHelper to new path org.oskari.init.OskariInitializer. This file is usually not customized so the change shouldn't have any effect on most instances. However we do have an instance that had WebappHelper copied to the application codebase with minor change to run migrations a bit different than in the built-in one. Mainly using other db-credentials for migrations than the app usually uses at runtime.

This adds a way of doing just that without the need to copy the whole file and maintain after changes. With this the application can add a custom class that implements org.oskari.init.CustomMigration and define oskari-ext.properties with:

db.flyway.migrationCls=foo.bar.CustomMigrationImpl

On launch the application would then run foo.bar.CustomMigrationImpl.migrateDB() instead of the normal migration process.

@ZakarFin ZakarFin marked this pull request as ready for review October 17, 2024 21:48
@ZakarFin ZakarFin added this to the 2.14.0 milestone Oct 17, 2024
@ZakarFin ZakarFin merged commit db879d4 into oskariorg:develop Oct 17, 2024
2 checks passed
@ZakarFin ZakarFin deleted the custom-migration branch October 17, 2024 21:59
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.

1 participant