Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
74 stars 32 forks source link

Add a --dirname option to the migration commands #340

Closed happy-river closed 3 years ago

happy-river commented 3 years ago

Support multiple directories of migration files, by adding an option to the migration commands to specify the directory to look in for migration files. Each directory will have its own associated migration history table in the database. Also add a new command, throat.py migration apply-up-to NAME to run a partial sequence of migrations.

This will allow developers who are working on long-running branches which include migrations to periodically rebase or merge their branches with master without having to renumber the migrations they have under development each time. Instead, they can keep their migrations under development in a separate directory, and move them to the migrations directory when they are ready to make a PR.

This will also allow forks of this project to have their own local directory of migrations to support custom features, without experiencing migration number collisions. It will still be up to the developer or the fork administrator to ensure that the migrations in the main directory and any additional directories are run in the desired order and do not conflict with each other.