https://github.com/atrox/go-migrate-rice
rice source driver for golang-migrate/migrate
https://github.com/atrox/go-migrate-rice
database golang golang-library migration migrations rice source-driver
Last synced: about 2 months ago
JSON representation
rice source driver for golang-migrate/migrate
- Host: GitHub
- URL: https://github.com/atrox/go-migrate-rice
- Owner: Atrox
- License: mit
- Created: 2019-01-08T13:53:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-24T12:13:01.000Z (about 3 years ago)
- Last Synced: 2025-07-31T14:34:00.297Z (9 months ago)
- Topics: database, golang, golang-library, migration, migrations, rice, source-driver
- Language: Go
- Size: 128 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rice Source Driver for golang-migrate/migrate
## Installation
```bash
go get github.com/atrox/go-migrate-rice
```
## Example
```golang
import (
rice "github.com/GeertJohan/go.rice"
migraterice "github.com/atrox/go-migrate-rice"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/postgres"
)
// get rice box
migrationsBox := rice.MustFindBox("migrations")
// create source driver with specified rice box
sourceDriver, _ := migraterice.WithInstance(migrationsBox)
// create database driver
dbDriver, _ := postgres.WithInstance(openDatabase(), &postgres.Config{})
// create migration instance
m, _ := migrate.NewWithInstance("rice", sourceDriver, "postgres", dbDriver)
// migrate
m.Up()
```