Many thanks! On Fri, Apr 16, 2021 at 2:07 PM Mike Bayer <mike...@zzzcomputing.com> wrote:
> > > On Fri, Apr 16, 2021, at 7:15 AM, Nikola Radovanovic wrote: > > Hi, > we have one Postgres DB with multiple schemes: > > 1. general (one schema, contains users and some common and data shared > between clients/clusters) > 2. client schemes: c_client_1, c_client_2, c_client_3, etc. (all > clients have same table layout, and have some access to general schema) > 3. cluster schemes: cl_cluster_1, cl_cluster_2, cl_cluster_3, etc. > (all clusters have same table layout, and have some access to general > schema) > > Basically, I want to find the best possible way to handle migrations - > preferably using one env.py/alembic.ini. > > > yes, use the recipe for passing --name, but you can have everything in one > alembic.ini file and one env.py file as long as that file knows how to > respond to the different environments > > > > > > Each client/cluster should have its migration table in its own schema and > general has its own migration table in general schema. Client and cluster > will share base class with. > > What I noticed is when using schema_translation_map, table layout is > detected OK, but when I run migration next time, it does not detect changes > in tables, but entire tables again. I guess it is due > schema_translation_map is not used then. > > > schema_translate_map is not supported by migrations right now: > https://github.com/sqlalchemy/alembic/issues/555 > > use the search_path recipe at > https://alembic.sqlalchemy.org/en/latest/cookbook.html#rudimental-schema-level-multi-tenancy-for-postgresql-databases > , this has been tested. > > > > > > > > Thank you in advance. > > Regards > > > -- > 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. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy-alembic/ed08c030-f35a-49c7-9ee3-5b263a7177a9n%40googlegroups.com > <https://groups.google.com/d/msgid/sqlalchemy-alembic/ed08c030-f35a-49c7-9ee3-5b263a7177a9n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sqlalchemy-alembic" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sqlalchemy-alembic/KRHod6Jbero/unsubscribe > . > To unsubscribe from this group and all its topics, send an email to > sqlalchemy-alembic+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy-alembic/bf8aa229-cb51-431d-a599-969a5592a262%40www.fastmail.com > <https://groups.google.com/d/msgid/sqlalchemy-alembic/bf8aa229-cb51-431d-a599-969a5592a262%40www.fastmail.com?utm_medium=email&utm_source=footer> > . > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy-alembic/CAH3us8S1OB8mM-ajP%3Daf4ER1_GTDSwKC-LRGHyW_rjCf5vG4yA%40mail.gmail.com.