8000 Rework sqlite fk pragma handling by MasterOdin · Pull Request #2365 · cakephp/phinx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rework sqlite fk pragma handling #2365

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

Open
wants to merge 8 commits into
base: 0.x
Choose a base branch
from
Open

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 <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
@MasterOdin MasterOdin marked this pull request as ready for review June 19, 2025 03:43
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
0