migrations.go 353 B

12345678910111213141516171819
  1. package migrations
  2. import "database/sql"
  3. type strings []string
  4. /**
  5. * simpleRun is a trivial wrapper executing SQL instructions without a result in sequence.
  6. */
  7. func simpleRun(tx *sql.Tx, instructions strings) error {
  8. for _, instruction := range instructions {
  9. _, err := tx.Exec(instruction)
  10. if err != nil {
  11. return err
  12. }
  13. }
  14. return nil
  15. }