예제 #1
0
func Upgrade(c *DatabaseConfig) (err error) {
	var m *gomigrate.Migrator
	m, err = getMigrator(c)
	if err != nil {
		fmt.Println(err)
		return
	}
	err = m.Migrate()
	return
}
예제 #2
0
// Migrate migrates database
func (a *App) Migrate(migrator gomigrate.Migrator) {
	if err := migrator.Migrate(); err != nil {
		log.Fatalln("migrations failed", err.Error())
	}
}