diff --git a/README.md b/README.md index d5c04cc..88ca418 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ goose is a database migration tool. -You can manage your database's evolution by creating incremental SQL (or, soon, Go) scripts. +You can manage your database's evolution by creating incremental SQL or Go scripts. # Install @@ -16,6 +16,9 @@ goose expects you to maintain a folder (typically called "db"), which contains t * a dbconf.yml file that describes the database configurations you'd like to use * a folder called "migrations" which contains .sql and/or .go scripts that implement your migrations +You may use the `--db` option to specify an alternate location for the folder containing your config and migrations. + + # Migrations goose supports migrations written in SQL or in Go. @@ -41,7 +44,7 @@ Notice the annotations in the comments. Any statements following `-- +goose Up` A sample Go migration looks like: - ::: go + :::go package migration_003 import ( @@ -59,7 +62,7 @@ A sample Go migration looks like: `Up()` will be executed as part of a forward migration, and `Down()` will be executed as part of a rollback. -A transaction is provided, rather than the DB instance directly, since we also need to record the schema version within the same transaction. Each migration should run as a single transaction anyway to ensure DB integrity, so it's good practice anyway. +A transaction is provided, rather than the DB instance directly, since goose also needs to record the schema version within the same transaction. Each migration should run as a single transaction to ensure DB integrity, so it's good practice anyway. ## Database Configurations @@ -69,6 +72,6 @@ A sample dbconf.yml looks like driver: postgres open: user=liam dbname=tester sslmode=disable -Here, 'development' specifies the name of the configuration, and the 'driver' and 'open' elements are passed directly to database/sql to access the specified database. +Here, `development` specifies the name of the configuration, and the `driver` and `open` elements are passed directly to database/sql to access the specified database. -You may include as many configurations as you like, and you can use the `--config` command line option to specify which one to use. goose defaults to using a configuration called "development". \ No newline at end of file +You may include as many configurations as you like, and you can use the `--config` command line option to specify which one to use. goose defaults to using a configuration called `development`. \ No newline at end of file