package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: May 27, 2019
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 2
Opens a new window with list of known importers.
README
¶
migration
Usage
Create a new migration
package main
import (
"github.com/dnnyjns/migration"
)
func main() {
migration.Create("first_migration")
}
Run migrations
package main
import (
_ "github.com/username/repo/migrations"
"github.com/dnnyjns/migration"
)
func main() {
db := setupDB()
defer db.Close()
migration.Run(db)
}
Documentation
¶
type Migration struct {
DisableDDL bool `gorm:"-"`
Perform performFn `gorm:"-"`
Version string `gorm:"size:255;PRIMARY_KEY;NOT NULL"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.