Merge pull request from duffn/readme

Update README
pull/43/head
Vojtech Vitek 2017-05-06 13:24:48 -04:00 committed by GitHub
commit 6b394259db
3 changed files with 62 additions and 23 deletions
cmd/goose
example/migrations-go/cmd

View File

@ -30,23 +30,31 @@ This will install the `goose` binary to your `$GOPATH/bin` directory.
```
Usage: goose [OPTIONS] DRIVER DBSTRING COMMAND
Drivers:
postgres
mysql
sqlite3
redshift
Commands:
up Migrate the DB to the most recent version available
up-to VERSION Migrate the DB to a specific VERSION
down Roll back the version by 1
down-to VERSION Roll back to a specific VERSION
redo Re-run the latest migration
status Dump the migration status for the current DB
dbversion Print the current version of the database
create Creates a blank migration template
Options:
-dir string
directory with migration files (default ".")
Examples:
goose postgres "user=postgres dbname=postgres sslmode=disable" up
goose mysql "user:password@/dbname" down
goose sqlite3 ./foo.db status
goose redshift "postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db" create init sql
Options:
-dir string
directory with migration files (default ".")
Commands:
up Migrate the DB to the most recent version available
down Roll back the version by 1
redo Re-run the latest migration
status Dump the migration status for the current DB
dbversion Print the current version of the database
create Creates a blank migration template
```
## create
@ -72,6 +80,13 @@ Apply all available migrations.
$ OK 002_next.sql
$ OK 003_and_again.go
## up-to
Migrate up to a specific version.
$ goose up-to 20170506082420
$ OK 20170506082420_create_table.sql
## down
Roll back a single migration from the current version.
@ -80,6 +95,13 @@ Roll back a single migration from the current version.
$ goose: migrating db environment 'development', current version: 3, target: 2
$ OK 003_and_again.go
## down-to
Roll back migrations to a specific version.
$ goose down-to 20170506082527
$ OK 20170506082527_alter_column.sql
## redo
Roll back the most recently applied migration, then run it again.

View File

@ -88,6 +88,12 @@ func usage() {
var (
usagePrefix = `Usage: goose [OPTIONS] DRIVER DBSTRING COMMAND
Drivers:
postgres
mysql
sqlite3
redshift
Examples:
goose postgres "user=postgres dbname=postgres sslmode=disable" up
goose mysql "user:password@/dbname" down
@ -99,11 +105,13 @@ Options:
usageCommands = `
Commands:
up Migrate the DB to the most recent version available
down Roll back the version by 1
redo Re-run the latest migration
status Dump the migration status for the current DB
dbversion Print the current version of the database
create Creates a blank migration template
up Migrate the DB to the most recent version available
up-to VERSION Migrate the DB to a specific VERSION
down Roll back the version by 1
down-to VERSION Roll back to a specific VERSION
redo Re-run the latest migration
status Dump the migration status for the current DB
dbversion Print the current version of the database
create Creates a blank migration template
`
)

View File

@ -77,6 +77,12 @@ func usage() {
var (
usagePrefix = `Usage: goose [OPTIONS] DRIVER DBSTRING COMMAND
Drivers:
postgres
mysql
sqlite3
redshift
Examples:
goose postgres "user=postgres dbname=postgres sslmode=disable" up
goose mysql "user:password@/dbname" down
@ -88,10 +94,13 @@ Options:
usageCommands = `
Commands:
up Migrate the DB to the most recent version available
down Roll back the version by 1
redo Re-run the latest migration
status Dump the migration status for the current DB
dbversion Print the current version of the database
up Migrate the DB to the most recent version available
up-to VERSION Migrate the DB to a specific VERSION
down Roll back the version by 1
down-to VERSION Roll back to a specific VERSION
redo Re-run the latest migration
status Dump the migration status for the current DB
dbversion Print the current version of the database
create Creates a blank migration template
`
)