hanami / cli

Hanami command line
MIT License
27 stars 28 forks source link

Update `db migrate` for new db layer #160

Closed timriley closed 3 months ago

timriley commented 3 months ago

Update db migrate to work for multiple databases configured across the app and its slices.

To find databases to operate on, it:

  1. Looks for all slices (app included) with a :db provider present, and groups these by their database URLs
  2. For each database URL, finds the slice that has a config/db/ directory - this is considered the "canonical" slice for the database.
  3. Migrates the database for each such slice.
    • If >1 slices have a config/db/, it prints a warning, and choose to operate on the first slice only.

The command also supports the following arguments:

Resolves #151