CreateMigrationsTable implements the Dialect interface to create the table which tracks applied migrations. It only creates the table if it does not already exist
(ctx context.Context, tx Queryer, tableName string)
| 39 | // table which tracks applied migrations. It only creates the table if it |
| 40 | // does not already exist |
| 41 | func (p postgresDialect) CreateMigrationsTable(ctx context.Context, tx Queryer, tableName string) error { |
| 42 | query := fmt.Sprintf(` |
| 43 | CREATE TABLE IF NOT EXISTS %s ( |
| 44 | id VARCHAR(255) NOT NULL, |
| 45 | checksum VARCHAR(32) NOT NULL DEFAULT '', |
| 46 | execution_time_in_millis INTEGER NOT NULL DEFAULT 0, |
| 47 | applied_at TIMESTAMP WITH TIME ZONE NOT NULL |
| 48 | ) |
| 49 | `, tableName) |
| 50 | _, err := tx.ExecContext(ctx, query) |
| 51 | return err |
| 52 | } |
| 53 | |
| 54 | // InsertAppliedMigration implements the Dialect interface to insert a record |
| 55 | // into the migrations tracking table *after* a migration has successfully |
nothing calls this directly
no test coverage detected