Add --gateway option to the following CLI commands:
db structure dump
db structure load
db create
db drop
db migrate
db version
generate migration
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:
Migrations for gateways in config/db/[gateway_name]_migrate/ directories
Structure files for gateways at config/db/[gateway_name]_structure.sql
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.
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:db structure dump
db structure load
db create
db drop
db migrate
db version
generate migration
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:
config/db/[gateway_name]_migrate/
directoriesconfig/db/[gateway_name]_structure.sql
The
db prepare
anddb 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 onedb/seeds.rb
file for a slice, and it should seed the tables across the slice's gateways as appropriate.