Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/go-rel/migration
Database Migration utility for REL
https://github.com/go-rel/migration
database go golang hacktoberfest mysql
Last synced: 13 days ago
JSON representation
Database Migration utility for REL
- Host: GitHub
- URL: https://github.com/go-rel/migration
- Owner: go-rel
- License: mit
- Created: 2022-02-23T06:02:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-02T05:05:33.000Z (5 months ago)
- Last Synced: 2024-10-29T16:20:42.429Z (22 days ago)
- Topics: database, go, golang, hacktoberfest, mysql
- Language: Go
- Homepage:
- Size: 52.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# migration
[![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
```go
package mainimport (
"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)