Update README.md (#316)

pull/317/head
Freek Wielstra 2022-02-26 00:58:57 +01:00 committed by GitHub
parent 699287dd75
commit 5cb7ab673d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -256,7 +256,10 @@ This feature can be used only for applying existing migrations. Modifying operat
`fix` and `create` will continue to operate on OS filesystem even if using embedded files. This is expected
behaviour because `io/fs` interfaces allows read-only access.
Example usage (assuming sql migrations placed in `migrations` directory):
Make sure to configure the correct SQL dialect, see [dialect.go](./dialect.go) for supported SQL dialects.
Example usage, assuming that SQL migrations are placed in the `migrations` directory:
```go
package main
@ -276,6 +279,10 @@ func main() {
goose.SetBaseFS(embedMigrations)
if err := goose.SetDialect("postgres"); err != nil {
panic(err)
}
if err := goose.Up(db, "migrations"); err != nil {
panic(err)
}