Skip to content

fix: SQLite-compatible DROP COLUMN in migration 6c0e5f8a9b1d downgrade#5874

Open
jonpspri wants to merge 1 commit into
IBM:mainfrom
jonpspri:fix/migration-6c0e5f8a9b1d-sqlite-downgrade
Open

fix: SQLite-compatible DROP COLUMN in migration 6c0e5f8a9b1d downgrade#5874
jonpspri wants to merge 1 commit into
IBM:mainfrom
jonpspri:fix/migration-6c0e5f8a9b1d-sqlite-downgrade

Conversation

@jonpspri

Copy link
Copy Markdown
Collaborator

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

…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>
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.

[BUG]: Migration 6c0e5f8a9b1d downgrade fails on SQLite (DROP COLUMN requires batch mode)

1 participant