Exemplo n.º 1
0
func (d DatabaseMigrator) Migrate(db *sql.DB, migrationsPath string) {
	sql_migrate.SetTable("notifications_model_migrations")

	migrations := &sql_migrate.FileMigrationSource{
		Dir: migrationsPath,
	}

	_, err := sql_migrate.Exec(db, "mysql", migrations, sql_migrate.Up)
	if err != nil {
		panic(err)
	}
}
Exemplo n.º 2
0
func init() {
	migrate.SetTable(migrationTable)
}