Re: [sqlalchemy] Writing code that works both before and after a migration

2016-07-06 Thread Jon Davidson
On Wed, Jul 6, 2016, at 12:25 PM, Mike Bayer wrote: > so yeah this use case is a big deal now, because all of openstack wants > to do it. > > However in openstack, they at least know what version the target schema > is at, so while they need to run code that talks to the "old" and "new" >

[sqlalchemy] Writing code that works both before and after a migration

2016-07-05 Thread Jon Davidson
In my current employer's setup, we use SQLAlchemy core and ORM, but we use a homegrown migration system instead of alembic. When possible, we want to write code so that it can work equally well with the old DB schema and the new DB schema. In this case, I am adding a column, and if the column