Skip to content

sqlite: Fix duplicate index statements in upgrade #4708

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 1 commit into
base: main
Choose a base branch
from

Conversation

mprather
Copy link

@mprather mprather commented Jul 4, 2025

The fall through case in logSuggestionsAndReturn simply appended whatever was received to the existing list. This in turn lead to duplicate index creation steps as seen in issue #3574.

In the upgrade scenario, the call to _moveDataStatements would create the statements to create the indexes on the new table. Then the foreach would turn right around and add more create index statements. This is resulted in broken upgrade experience b/c upgrade would attempt to create 2x indexes as needed.

The fix verifies a statement does not already exist before appending to the statement list.

The fall through case in logSuggestionsAndReturn simply
appended whatever was received to the existing list. This
in turn lead to duplicate index creation steps as seen
in issue drizzle-team#3574.  Verify a statement does not already
exist before appending to the list.
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