Пример #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
}