Skip to content

Commit

Permalink
Readme for version with providers
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsalnikov committed Apr 30, 2022
1 parent f00bd15 commit 2b2d652
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (

_ "github.com/go-sql-driver/mysql"
"github.com/iamsalnikov/mymigrate"
"github.com/iamsalnikov/mymigrate/provider/mysql"
)

func main() {
Expand All @@ -56,7 +57,8 @@ func main() {
log.Fatalln(err)
}

mymigrate.SetDatabase(db)
provider := mysql.NewMysqlProvider(db)
mymigrate.SetDatabaseProvider(provider)
```
### Add migrations
Expand Down Expand Up @@ -161,4 +163,4 @@ Package `github.com/iamsalnikov/mymigrate/cobracmd` export next commands:
- [NewListCmd](cobracmd/new_cmd.go) - command to view a list of new migrations
- [MigrateCmd](cobracmd/cmd.go) - root command to work with migrations
Also you can find at `github.com/iamsalnikov/mymigrate/cobracmd` functions for cobra commands if you want to configure commands by yourself.
Also you can find at `github.com/iamsalnikov/mymigrate/cobracmd` functions for cobra commands if you want to configure commands by yourself.

0 comments on commit 2b2d652

Please sign in to comment.