Hello,
the preffered way is to separate application from migrations as much
as possible.
This is really a topic that is troublesome for new users since it
makes you duplicate code. You don't have to store your whole schema to
version 0. When you need to change DB schema, copy all the tables that
will be changed to upgrade script, modify them in upgrade/downgrade
functions and update models in application to latest state.
In most cases, all you need to do is:
# all imports
users = Table('users', metadata, autoload=True)
new_col = Column('id', integer)
upgrade(migrate_engine):
users.create_column(new_col)
downgrade(migrate_engine):
users.drop_column(new_col)
# end
Of course, you can find your solution that fits your needs and share
it with migrate users:)
d.