Hi,
I have a bit unusual use-case in software I work on. 

There are three main "namespaces" (kinds of data): first one is "general" 
(not multi-tenant), where we keep some common security and settings data.

Second one is "client", where we keep clients (which are 
companies/organisations) and this one is multi-tenant, so multiple clients 
share same table layout and there are also relationships between "general" 
and "client" tables. 

Third one can be seen as a "cluster" where we keep data "clients" wants to 
share among each other. "Cluster" is multi-tenant, so all "clusters" share 
same table layout, and which differs somewhat with the one in "client". 
There might be relationships between "cluster" and "general", but most 
probably not with the "client".

Now, my questions are related to what would be the best way to create a 
migration management based on Alembic in this case?

   1. I guess some custom migration script  based on Alembic API
   2. where to keep migration related data table - one in "general" schema 
   for "general" tables, then each "client" and "cluster" schema has its own
   3. how to pass "clients" and "cluster" for which we want to perform 
   migration? Shall we read them from DB itself, or pass as command line 
   params (by default do for all)
   4. I have not use Alembic API so far, so what would be the best place to 
   start - apart official docs is there any recommended tutorial or something 
   similar?

Also, as a side question, I guess separate *declarative_base* for 
"general", "client" and "cluster" would be a good thing, or shall we use 
one - common for all, but in which case we have to decide on thy fly which 
tables belongs to "clients" and which to "clusters" so we don't mix them.

Thank you in advance.

Kindest 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/d130316d-5974-4c98-abb1-e5af64a370c9n%40googlegroups.com.

Reply via email to