readme: tweaks

pull/2/head
Liam Staskawicz 2012-12-10 09:12:43 -08:00
parent 2454507384
commit 8394b86b46
1 changed files with 8 additions and 5 deletions

View File

@ -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".
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`.