On Tue, 2012-12-04 at 10:13:22 -0800, junepeach wrote: > Thanks Audrius. Do you have a simple working example in sqlalchemy? I > am not familiar with sqlalchemy. My migration script will separate > from other python development codes. So it is better to put 'PRAGMA > foreign_keys=ON' in a configuration file. I am pretty new to all of > those stuff.
I assume that by "configuration script" you mean env.py (as I said in my previous mail, I'm not familiar with Alembic). According to the docs, that's the place where SA engine is created. Have you tried to place the code snippet from the link that I gave you in env.py? Perhaps that is all that's needed for SQLite's foreign key constraint to take effect in Alembic migration scripts. -- Audrius Kažukauskas http://neutrino.lt/
pgp0qKR68LGn1.pgp
Description: PGP signature