= migrate.
== Link
:hide-uri-scheme:
If you have questions about this application, there was a bug or there are suggestions for improvement, then you can ask it in Issues, or in link:telegram[https://t.me/zergsLaw]
== Migration cli.
Thin and lightweight client for performing migrations supports commands for migrations and their rollback.
[source]
----
USAGE:
migrate command [command options] [arguments...]
----
== Install.
----
GO111MODULE=on go get github.com/Meat-Hook/migrate
----
=== Basic commands.
[source]
----
COMMANDS:
version get version
run exec migrate
create create migrate file
help, h Shows a list of commands or help for one command
----
== Creating a migration file.
[source]
----
USAGE:
migrate create [command options]
OPTIONS:
--migrate-name value, -M value migration file name
--dir value, -D value migration file location
--help, -h show help (default: false)
----
== Example:
[source,bash]
----
// Also note that there are many default parameters for a convenient start.
migrate create --dir migrates --migrate-name create_user_table
// Up migrate
migrate run --opration up --dir migrates --dsn <dsn>
// Rollback all migrates
migrate run --opration reset --dir migrates --dsn <dsn>
----