CLI Overview
The CLI command for migrations is migrate
, aliased m
. You
can see all the commands and options using the --help
switch.
formn --help
formn migrate --help
The migrate
command has the following options:
--connections-file
, aliased as-c
. The path to aconnections.json
file, which defaults to./connections.json
.--flavor
, aliased-f
. The database type, which defaults tomysql
.--migrations-dir
, aliased-m
. A directory that holds migration scripts. It defaults tomigrations
.
migrate
has four sub-commands:
create
: Create a new template migration script.up
: Run all new migrations against the connection(s) defined inconnections.json
.down
: Undo the most recent migration.run
: Run a custom migration script against the database.
We’ll look at each of these sub-commands in the next sections.