[sqlalchemy] add foreign key constraint

2013-11-14 Thread jonas geiregat
I have a table called session which has foreign key constraints. I removed them and auto generated a migration script. The upgrade function is populated as expected but the downgrade function isn't. I searched through the available operations but can't find what i need. The create_foreign_key

Re: [sqlalchemy] add foreign key constraint

2013-11-14 Thread Simon King
On Thu, Nov 14, 2013 at 8:47 AM, jonas geiregat geiregatjo...@gmail.com wrote: I have a table called session which has foreign key constraints. I removed them and auto generated a migration script. The upgrade function is populated as expected but the downgrade function isn't. I searched

Re: [sqlalchemy] add foreign key constraint

2013-11-14 Thread jonas geiregat
If I use create_foreign_key then I end up with sequence tables in my database... def upgrade(): op.drop_constraint('session_server_fkey', 'session', 'foreignkey') op.drop_constraint('session_app_fkey', 'session', 'foreignkey') def downgrade(): op.create_foreign_key(