I would definitely agree using postgres in both dev and prod is the way
to go here; sqlite behaves sufficiently differently, particularly around
DDL.

At Axial we previously had multiple databases in concurrent use, with
migrations operating on both databases at once. We modified env.py's
run_migrations_online() to support multiple engines (and modified our
script.py.mako migration template) for the same purpose.) I can probably
share our approach, but I think it would require some adaption to your
needs.

If you merely have different installations of the same db schema (dev
and prod), it is IMHO better to use the same migrations for both and
just have different alembic.ini files.


On Tue, Nov 17, 2015, at 04:27 AM, Nicholas Cole wrote:
> I suspect that this has been asked before in various ways, and perhaps 
> there's a way of making the documentation section on "multiple databases" 
> clearer, but my question is:
> 
> Can I use the same migration scripts for multiple database engines, or do
> I 
> need entirely separate alembic folders to handle sqlite and postgres 
> migrations?
> 
> I can see that if I were using the same database engine for development
> and 
> production that things would be simpler.
> 
> Just as an aside: there are two different ways in which one might want to 
> use "multiple databases".  One is where a project actually needs multiple 
> databases to work at all - i.e. where the data is spread across multiple 
> databases.  The other is where multiple installations of a project (e.g. 
> development and production databases) are being kept in sync.  Perhaps 
> something could be added to the documentation to make handling these two 
> cases clearer.
> 
> I hope my question makes sense, and I'd be really grateful for any 
> clarification!
> 
> Best wishes,
> 
> Nicholas
> 
> -- 
> 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.

-- 
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.

Reply via email to