Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
render inline CHECK constraint for ADD COLUMN on sqlite #98
Migrated issue, originally created by Márcio Moreira (@arqeco)
I´ve tried without success to add a boolean column to a sqlite file.
File "C:\Python27\lib\site-packages\sqlalchemy\engine\default.py", line 331, in do_execute
The only way it worked was changing
I am new to sqlalchemy and databases in general. Is it the create_constraint=False mandatory for Sqlite databases in alembic?
Michael Bayer (@zzzeek) wrote:
I'd say you've had success as just using that flag allows it to skip that part of SQLite ALTER which is not supported. Until 0.4.2 comes out that is the workaround.
SQLite has very little support for ALTER and schema migrations. In this case, SQLAlchemy itself doesn't support the column-inline CHECK syntax SQLite is requiring, so for now the CHECK constraint is skipped in b3bc2d8.
This ticket needs to stay open because theoretically we can support the addition of the CHECK constraint as well but SQLAlchemy itself would need some changes to handle this.