fix: SQLite-compatible DROP COLUMN in migration 6c0e5f8a9b1d downgrade#5874
Open
jonpspri wants to merge 1 commit into
Open
fix: SQLite-compatible DROP COLUMN in migration 6c0e5f8a9b1d downgrade#5874jonpspri wants to merge 1 commit into
jonpspri wants to merge 1 commit into
Conversation
…rade Downgrade in migration 6c0e5f8a9b1d was using individual op.drop_column() calls outside batch_alter_table, which fails on SQLite < 3.35.0 that lacks native DROP COLUMN support. Closes IBM#5873 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Signed-off-by: Jonathan Springer <jps@s390x.com>
jonpspri
requested review from
Lang-Akshay,
brian-hussey,
crivetimihai,
ja8zyjits and
msureshkumar88
as code owners
July 25, 2026 09:37
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.
Summary
The downgrade() function in migration 6c0e5f8a9b1d uses individual op.drop_column() calls outside of batch_alter_table, which fails on SQLite versions prior to 3.35.0.
Fix
Replaced the per-column op.drop_column loop with a batch_alter_table block following the same pattern used in other SQLite-compatible migrations in this codebase.
Testing
Local SQLite is 3.51.0 (>= 3.35.0) so the original code would pass here. The fix maintains backward compatibility.
For SQLite < 3.35.0: Original code FAILS, Fixed code WORKS.
For SQLite >= 3.35.0: Both versions WORK.
Closes #5873