You can configure an include_object() function which can inspect the model and decide whether or not to include the model in autogenerated migrations:
http://alembic.readthedocs.org/en/latest/api/runtime.html#alembic.runtime.environment.EnvironmentContext.configure.params.include_object Then you just need some way of marking this on the model; I recommend putting a value in the 'info' dict which most SQLAlchemy schema objects have. On Tue, Nov 17, 2015, at 09:19 AM, Michal Petrucha wrote: > Hi everyone, > > In short, is it possible to use migrations for some declarative > classes, but not others? > > A bit more background: Certain parts of our project are relatively > stable, and we want to use a migration tool for those. However, there > are also some components that are highly experimental prototypes, and > using migrations for those would just introduce extra overhead, and > simply dropping their tables and create_all-ing them is often easier. > > I'm aware that we could use separate declarative bases with separate > metadata, and only tell Alembic about one of them, but that way we'd > lose the ability to create foreign key references from the > experimental classes into those migrated by Alembic. (We don't have > any references in the other direction.) > > Has anyone tried doing something like this before? Or is this a wrong > way of approaching this problem, and is there a better “standard” > solution for it? > > Regards, > Michal > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/d/optout. > Email had 1 attachment: > + signature.asc > 1k (application/pgp-signature) -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
