Skip to content
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

SqliteMigrator: Using sqlite3.version_info instead of sqlite3.sqlite_version_info #2759

Closed
henriquegemignani opened this issue Jul 28, 2023 · 3 comments

Comments

@henriquegemignani
Copy link

From official documentation, sqlte3.version_info is the module's version, not SQLite's version. The desired variable is sqlite_version_info.

With Python 3.11.1 from official distribution, version_info is (2, 6, 0) while sqlite_version_info is (3, 39, 4).

This causes drop_column/rename_column to always use the legacy path.

@coleifer
Copy link
Owner

Thank you for catching this, will work up a fix.

@coleifer
Copy link
Owner

I've added a patch. Note that Sqlite's ALTER...DROP COLUMN is fairly limited and will not do things like drop affected indexes, and instead will raise an error. So it is necessary, when using the new forms, to be sure to drop affected indexes/constraints/etc first.

@henriquegemignani
Copy link
Author

Appreciated! I just want to rename a column so at least my case is easy :)

coleifer added a commit that referenced this issue Jul 28, 2023
Fixes failing tests because Sqlite's DROP COLUMN does not handle
anything like updating/dropping an affected index, etc.

Fixes #2759
gshmu pushed a commit to gshmu/peewee that referenced this issue Aug 22, 2023
Fixes failing tests because Sqlite's DROP COLUMN does not handle
anything like updating/dropping an affected index, etc.

Fixes coleifer#2759
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

No branches or pull requests

2 participants