Repository navigation
Conversation
A downstream Spring Boot application reported a fixture row that vanished while Flyway reported success, with PRAGMA foreign_keys = ON for every connection. The sample separates the two shapes involved: - seeding a parent and then INSERT OR IGNORE children across migrations keeps every row; - a later migration that rebuilds a parent table with copy, drop, rename removes the child rows, because DROP TABLE runs an implicit DELETE FROM and ON DELETE CASCADE fires. The cascade is SQLite's documented behavior, not row loss in the driver. With a child foreign key that has no cascade, the same rebuild fails with FOREIGN KEY constraint failed, which pins that enforcement is active for every connection Flyway takes. FlywaySqldSupport now takes the foreign_keys pragma instead of a boolean, so the enabled and disabled cases share one code path.
Performance benchmarkBase Driver-side microbenchmarks only; server and network time are excluded. Shared-runner noise is about ±10%, so only larger regressions are flagged. JDK 25.0.5, Linux amd64, 4 CPUs. Throughput
Allocation
Workloads and thresholds live in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a generalized Flyway integration test for a downstream report: a seeding migration appeared to lose a child row while Flyway reported success, with
PRAGMA foreign_keys = ONon every connection.The sample separates three shapes, all through this driver to a real sqld container:
INSERT OR IGNOREand plainINSERT, keeps every row.DROP TABLEruns an implicitDELETE FROM, andON DELETE CASCADEfires. That is SQLite's documented behavior, and it reproduces the downstream symptom without a driver bug.FOREIGN KEY constraint failed, which pins that enforcement is active for every connection Flyway takes.FlywaySqldSupportnow takes theforeign_keyspragma value instead of a boolean, so the enabled and disabled cases share one code path.Why
FlywayKnownGapsITonly covers for the disabled case.DROP TABLEunder foreign keys firesON DELETEactions, so a migration that rebuilds a referenced table can remove child rows unless the rebuild runs with foreign keys off.Test
DOCKER_CONFIG="$PWD/libsql-conformance/src/test/docker-config" \ ./mvnw -pl libsql-jdbc verifyAll
libsql-jdbcunit and integration tests pass, including the newFlywayForeignKeySeedITagainst the pinnedv0.24.33image. Also run against-Dlibsql.image=ghcr.io/tursodatabase/libsql-server:latestlocally, with the same result.Notes
The report came from a Spring Boot application using a Hikari pool with
connection-init-sql: PRAGMA foreign_keys = ON. That setup is not part of this test; the DataSource wrapper sets the same pragma before Flyway takes the connection, which is the property that matters. A pooled variant can be added tolibsql-itestsif there is appetite for a Hikari dependency in these Flyway tests.