hanami / cli

Hanami command line
MIT License
28 stars 31 forks source link

Update DB commands to support multiple gateways per slice #232

Closed timriley closed 1 month ago

timriley commented 1 month ago

Update the CLI for the DB gateway support introduced in https://github.com/hanami/hanami/pull/1452:

Add --gateway option to the following CLI commands:

These commands will operate on an individual gateway when the --gateway is given. Otherwise, they will operate on all the gateways for a given app or slice (or the app and all slices) based on the other args given, as before.

The above commands work with the following new file structures:

The db prepare and db seed commands do not support a --gateway option. This is because these commands are intended to operate on an app or slice as a whole. For example, there is only one db/seeds.rb file for a slice, and it should seed the tables across the slice's gateways as appropriate.