I'm wondering how to solve an issue.
One developer created migration 1efb
upgrade:
drop view v1 -- moved to query in the code
downgrade:
create view v1 as select 1
Another developer created a migration c787
upgrade:
create or replace view v1 as select 2
downgrade
create or replace view v1 as select 1
Now I'm merging them with alembic merge heads.
I get revision = 60e8, down_revision = (c787, 1efb).
My question is which migration runs first. If 1efb goes first, c787 will fail. If 1efb goes first upgrade is smooth.
My concern is some databases are at 1efb and some are at c787. For the database at 1efb, how to I prevent a failure? Can I put some logic in upgrade() (and downgrade()) to prevent this?
Thanks,
Brian
PS: It's actually a bit more complicated than this because I'm merging git forks.