On May 11, 2014, at 9:03 AM, Steeve C <steevechaill...@gmail.com> wrote:
> hi, > > I'm looking for writing plugins (stevedore) for my application, all plugins > are new python modules and can create some entry|columns|table in the > application database, I want to manage migration by plugins|modules > > is it possible using alembic? > > is there some documentation on that purpose? Currently, a single Alembic directory maintains a linear list of migrations, that is, A, B, C, D.... in a sequential pattern. So if the idea here is that you have multiple, independent "apps" with their own migration streams, at the moment a workaround is to maintain separate Alembic directories per "app", and then use different "version_table" entries for each. This is a little verbose but it can be done using different named sections in alembic.ini, e.g.: [alembic_app1] version_table = app1_migration_version script_location = path/to/app1_migrations/ [alembic_app2] version_table = app2_migration_version script_location = path/to/app2_migrations/ ... then in env.py: context.configure( connection=connection, target_metadata=target_metadata, version_table=config.get_main_option("version_table") ) then when you run alembic: alembic upgrade head --name alembic_app2 For now, that's it. But later, a better approach will be available, when we will add support for multiple version directories and multiple independent branches. I hope to have funded support for these features within the next six months, see https://bitbucket.org/zzzeek/alembic/issues?status=new&status=open&milestone=tier%201. -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alembic+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.