Skip to content

Conversation

MasterOdin
Copy link
Member

@MasterOdin MasterOdin commented Jun 18, 2025

PR reworks how we handle the foreign key pragma in sqlite, so that we turn on the pragma before doing any plan actions, and turn it back on after all actions have run (vs doing it within an action sequence, potentially repeatedly). This is accomplished by introducing a new pre and post hook to the executeActions flow that the sqlite adapter specifically takes advantage of. This should make it possible to potentially re-order and rework how certain plans are generated for sqlite, with an immediate goal of allowing a user to both change a primary key and set identity on it within the same alter chain.

The only downside I could think of is that this may make us do the FK validation step more often as some commands could avoid it, but it's quick enough that I don't think there's real harm in it.

Signed-off-by: Matthew Peveler <[email protected]>
Signed-off-by: Matthew Peveler <[email protected]>
Signed-off-by: Matthew Peveler <[email protected]>
Signed-off-by: Matthew Peveler <[email protected]>
Signed-off-by: Matthew Peveler <[email protected]>
Signed-off-by: Matthew Peveler <[email protected]>
@MasterOdin MasterOdin marked this pull request as ready for review June 19, 2025 03:43
@MasterOdin MasterOdin merged commit 693ace8 into 0.x Jul 8, 2025
12 checks passed
@MasterOdin MasterOdin deleted the chore-foreign-key-pragma branch July 8, 2025 18:55
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