loco icon indicating copy to clipboard operation
loco copied to clipboard

Decoupling loco-cli from project for db related commands.

Open HiImJulien opened this issue 5 months ago • 2 comments

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:

  1. Create a new database.
  2. Forget to run the initial migrations.
  3. Run cargo loco db entities.
  4. 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

--

HiImJulien avatar Jan 25 '24 17:01 HiImJulien