sqldb-postgresql ships mandatory Flyway migrations that may conflict with project migrations #21
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/support#21
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
sqldb-postgresqlmodule (as of 0.1.11) includes two Flyway migration files on the classpath atdb/migration/postgresql/:V1__create_message_catalogue.sql— message catalogue tables with audit trailV2__create_permissions.sql— ReBAC permissions tableThese migrations run automatically whenever a project uses
PostgreSQLTestingLayers.flywayMigrationServiceLayer(which scansclasspath:db/migration/postgresql) or configures Flyway with that location.Issues
Version conflicts: Projects that already have their own V1/V2 migrations at
db/migration/postgresqlwill getFlywayException: Found more than one migration with version 1. We hit this inxml-rozhraniafter upgrading to 0.1.11 and had to renumber all project migrations to V100+.Unwanted tables: Projects that don't use message catalogue or permissions features will still get those tables created in their database. This violates the principle of least surprise — a database infrastructure dependency shouldn't impose schema changes.
Version number reservation: Library-level migrations occupying V1/V2 forces all downstream projects to work around those version numbers, which doesn't scale if more built-in migrations are added in future releases.
Suggested Approaches
db/migration/postgresql/iw-support) and let projects opt in by adding that location to their Flyway config.V0_001__or repeatable migrationsR__).Context
Discovered while upgrading
xml-rozhranifrom0.1.10-SNAPSHOTto0.1.11. ThePostgreSQLTestingLayerswas also moved fromworks.iterative.sqldb.testingtoworks.iterative.sqldb.postgresql.testingin this version, which is a breaking change worth noting in release notes.