示例#1
0
func MigrateDatabase() error {
	cfg, err := config.FromEnv()
	if err != nil {
		return err
	}
	return migrator.Run(cfg.DB.DB, "api/migrations")
}
示例#2
0
func Migrate() error {
	db, err := Openenv()
	if err != nil {
		return err
	}
	err = migrator.Run(db.DB, "migrations")
	if err != nil {
		return err
	}
	return nil
}