themotte / rDrama

This code runs https://www.themotte.org. Forked from https://github.com/Aevann1/rDrama
GNU Affero General Public License v3.0
26 stars 31 forks source link

See if there's a way to tell Alembic the intended version #566

Open zorbathut opened 1 year ago

zorbathut commented 1 year ago

Right now Alembic seems to just update to "the latest db version it's aware of". In an ideal world it would know what db version it's meant to be on, and then update to this. This is relevant if we need to downgrade; it would be nice to be able to just deploy a server with all the migrations available and tell it "go to this version (which is not the most recent)".

justcool393 commented 1 year ago

alembic upgrade <revision> or alembic downgrade <revision> with alembic current for the current revision in a shell will work i think?

zorbathut commented 1 year ago

Yeah, the issue is:

On the other hand, maybe downgrades shouldn't be easy, I really don't want to accidentally do a major downgrade and blow away a ton of info.

justcool393 commented 1 year ago

related: #555

VietThan commented 1 year ago

It's possible to use alembic in a python script (SO question). I see there is downgrade and upgrade in there.