InsertAppliedMigration implements the Dialect interface to insert a record into the migrations tracking table *after* a migration has successfully run.
(ctx context.Context, tx Queryer, tableName string, am *AppliedMigration)
| 55 | // into the migrations tracking table *after* a migration has successfully |
| 56 | // run. |
| 57 | func (p postgresDialect) InsertAppliedMigration(ctx context.Context, tx Queryer, tableName string, am *AppliedMigration) error { |
| 58 | query := fmt.Sprintf(` |
| 59 | INSERT INTO %s |
| 60 | ( id, checksum, execution_time_in_millis, applied_at ) |
| 61 | VALUES |
| 62 | ( $1, $2, $3, $4 )`, |
| 63 | tableName, |
| 64 | ) |
| 65 | _, err := tx.ExecContext(ctx, query, am.ID, am.MD5(), am.ExecutionTimeInMillis, am.AppliedAt) |
| 66 | return err |
| 67 | } |
| 68 | |
| 69 | // GetAppliedMigrations retrieves all data from the migrations tracking table |
| 70 | func (p postgresDialect) GetAppliedMigrations(ctx context.Context, tx Queryer, tableName string) (migrations []*AppliedMigration, err error) { |
nothing calls this directly
no test coverage detected