// ApplyMigrations applies migrations from dir to create valid tables.
// First naiive impl, applies all migrations from folder, step by step.
ApplyMigrations applies migrations from dir to create valid tables.
First naiive impl, applies all migrations from folder, step by step.
// ApplyMigrations applies migrations from dir to create valid tables . // First naiive impl applies all migrations from folder step by step .
func (d *DB) ApplyMigrations() {
	for i, m := range migrations {
		if _, err := d.pool.Exec(d.ctx, m); err != nil {
			log.Infof("PostgresDB: couldn't apply #%d migration, check it: \n%s", i, m)
		}
	}
	log.Infof("PostgresDB: %d migrations applied succesfully", len(migrations))
}
func ( d * DB ) ApplyMigrations ( ) { for i , m := range migrations { if _ , err := d . pool . Exec ( d . ctx , m ) ; err != nil { log . Infof ( " \n " , i , m ) } } log . Infof ( " " , len ( migrations ) ) }
ApplyMigrations applies migrations from dir to create valid tables.
ApplyMigrations applies migrations from dir to create valid tables .