Skip to content

Commit

Permalink
doc/md: documentation for named versioned migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
masseelch committed Mar 10, 2022
1 parent 515fe98 commit 5b184f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/md/versioned-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func main() {
}
// Write migration diff.
err = client.Schema.Diff(ctx, schema.WithDir(dir))
// You can use the following method to give the migration files a name.
// err = client.Schema.NamedDiff(ctx, "migration_name", schema.WithDir(dir))
if err != nil {
log.Fatalf("failed creating schema resources: %v", err)
}
Expand Down Expand Up @@ -137,6 +139,10 @@ func main() {
if err := m.Diff(context.Background(), tbls...); err != nil {
log.Fatalln(err)
}
// You can use the following method to give the migration files a name.
// if err := m.NamedDiff(context.Background(), "migration_name", tbls...); err != nil {
// log.Fatalln(err)
// }
}
```

Expand Down

0 comments on commit 5b184f2

Please sign in to comment.