diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2024-01-13 19:18:42 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2024-01-13 19:18:42 -0500 |
| commit | 913272fba0c6b429ef8ce9f04498ebc5d5b653be (patch) | |
| tree | 2ad900f1648fd2ac7d0b1482978b62d9ddd4e63f | |
| parent | Add ability to upgrade/downgrade to specific version (diff) | |
| download | cli-913272fba0c6b429ef8ce9f04498ebc5d5b653be.zip | |
Add command reference
| -rw-r--r-- | README.md | 51 | ||||
| -rw-r--r-- | internal/commands/down.go | 2 | ||||
| -rw-r--r-- | internal/commands/new.go | 2 | ||||
| -rw-r--r-- | internal/commands/up.go | 2 |
4 files changed, 54 insertions, 3 deletions
@@ -33,6 +33,11 @@ Bolt is a command-line tool designed to simplify and streamline your database mi - [Configuration](#configuration) - [Configuration File](#configuration-file) - [Environment Variables](#environment-variables) + - [Commands](#commands) + - [`bolt new`](#bolt-new) + - [`bolt up`](#bolt-up) + - [`bolt down`](#bolt-down) + - [`bolt status`](#bolt-status) - [Explanation](#explanation) - [How Are Migration Scripts Executed?](#how-are-migration-scripts-executed) - [How Does Bolt Know What Migrations Have Been Applied?](#how-does-bolt-know-what-migrations-have-been-applied) @@ -263,6 +268,52 @@ All configuration file settings have corresponding environment variables. - `BOLT_CONNECTION_DBNAME` - `BOLT_CONNECTION_DRIVER` +### Commands + +#### `bolt new` + +```bash +$ bolt help new +new [-message|-m]: + Create a new database migration + -m string + alias for -message (default "autogenerated") + -message string + Message to use for the migration (default "autogenerated") +``` + +#### `bolt up` + +```bash +$ bolt help up +up [-version|-v]: + Apply migrations against the database + -v string + alias for -version + -version string + The version to upgrade up and including to. +``` + +#### `bolt down` + +```bash +$ bolt help up +down [-version|-v]: + Downgrade migrations against the database. + -v string + alias for -version + -version string + The version to downgrade down and including to. +``` + +#### `bolt status` + +```bash +$ bolt help status +status: + List the database migrations and their statuses +``` + ## Explanation ### How Are Migration Scripts Executed? diff --git a/internal/commands/down.go b/internal/commands/down.go index e974cdf..2beae2e 100644 --- a/internal/commands/down.go +++ b/internal/commands/down.go @@ -25,7 +25,7 @@ func (*DownCmd) Synopsis() string { } func (*DownCmd) Usage() string { - return `down: + return `down [-version|-v]: Downgrade migrations against the database. ` } diff --git a/internal/commands/new.go b/internal/commands/new.go index 79c0ceb..864de4e 100644 --- a/internal/commands/new.go +++ b/internal/commands/new.go @@ -26,7 +26,7 @@ func (*NewCmd) Synopsis() string { } func (*NewCmd) Usage() string { - return `create [-message|-m]: + return `new [-message|-m]: Create a new database migration ` } diff --git a/internal/commands/up.go b/internal/commands/up.go index f27c054..57f9109 100644 --- a/internal/commands/up.go +++ b/internal/commands/up.go @@ -25,7 +25,7 @@ func (*UpCmd) Synopsis() string { } func (*UpCmd) Usage() string { - return `up: + return `up [-version|-v]: Apply migrations against the database ` } |