loco
loco copied to clipboard
Decoupling loco-cli from project for db related commands.
Description
Sometimes, the project is in a state, in which the project does not compile. Maybe you were to eager and implemented a function against a entity, that does not exist yet. Maybe a migration has not run yet or you've broken your project like described below.
If in such a state, running cargo loco
fails, because the main project does not compile,
making you unable to run migrations from loco-cli
.
To Reproduce
I've had this idea because I broke my project by accident:
- Create a new database.
- Forget to run the initial migrations.
- Run
cargo loco db entities
. - Et voilá! Your project is in a defunct state. Migrations and entities cannot be generated.
Expected Behavior
Since the migrations are stored in a separate project, it'd be great if we could run them from loco-cli even though the main project does not compile, without having to run migration executable manually and creating the missing entities manually.
Environment:
--
Additional Context
--