Skip to content

test(flyway): replace deprecated initSql in the clean bootstrap - #275

Merged
magnusp merged 1 commit into
mainfrom
docs/273-flyway-datasource-init
Oct 31, 2026
Merged

magnusp merged 1 commit into
mainfrom
docs/273-flyway-datasource-init

Conversation

@magnusp

@magnusp magnusp commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Closes #273.

What changed

  • FlywayKnownGapsIT now uses a DataSource that runs PRAGMA foreign_keys = OFF on each connection before returning it, instead of the deprecated initSql.
  • README.md recommends a pool/DataSource connection-init statement (spring.datasource.hikari.connection-init-sql) and explains why an AFTER_CONNECT callback is not enough: Flyway has already disabled auto-commit when it runs, so the driver starts a transaction before the pragma and SQLite ignores it.

Verification

  • Targeted FlywayKnownGapsIT and FlywayMigrationIT against the pinned sqld container
  • ./mvnw -pl libsql-jdbc -am test
  • ./mvnw spotless:check
  • No Flyway initSql deprecation warning remains.

Replace deprecated initSql with a DataSource that runs
PRAGMA foreign_keys = OFF before returning each connection. An
AFTER_CONNECT callback is not sufficient: Flyway has already disabled
auto-commit when it runs, so the driver begins a transaction before the
pragma and SQLite ignores it. Document the pool/DataSource connection-init
setup instead. Closes #273.
@magnusp
magnusp merged commit 3760d39 into main Oct 31, 2026
6 checks passed
@magnusp
magnusp deleted the docs/273-flyway-datasource-init branch October 31, 2026 02:24
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.

Replace deprecated Flyway initSql in the clean bootstrap

1 participant