Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Fs02 committed Feb 23, 2022
1 parent 47250ff commit b06566b
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# migration
Database Migration utility for REL

[![GoDoc](https://godoc.org/github.com/go-rel/migration?status.svg)](https://pkg.go.dev/github.com/go-rel/migration)
[![Test](https://github.com/go-rel/migration/actions/workflows/test.yml/badge.svg)](https://github.com/go-rel/migration/actions/workflows/test.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-rel/migration)](https://goreportcard.com/report/github.com/go-rel/migration)
[![codecov](https://codecov.io/gh/go-rel/migration/branch/main/graph/badge.svg?token=1yyLz5sbBR)](https://codecov.io/gh/go-rel/migration)
[![Gitter chat](https://badges.gitter.im/go-rel/rel.png)](https://gitter.im/go-rel/rel)

Database Migration utility for Golang.

## Example

```gopackage main
import (
"context"
"github.com/go-rel/doc/examples/db/migrations"
"github.com/go-rel/mysql"
"github.com/go-rel/rel"
"github.com/go-rel/rel/migrator"
_ "github.com/go-sql-driver/mysql"
)
func main() {
var (
ctx = context.TODO()
repo = rel.New(mysql.MustOpen("root@(source:3306)/rel_test?charset=utf8&parseTime=True&loc=Local"))
m = migrator.New(repo)
)
// Register migrations
m.Register(20202806225100, migrations.MigrateCreateTodos, migrations.RollbackCreateTodos)
// Run migrations
m.Migrate(ctx)
// OR:
// m.Rollback(ctx)
}
```

More Info: https://go-rel.github.io/migration

## License

Released under the [MIT License](https://github.com/go-rel/migration/blob/master/LICENSE)

0 comments on commit b06566b

Please sign in to comment.