PostgresqlMigrationRunner class

Applies, records, and rolls back PostgreSQL migrations.

Constructors

PostgresqlMigrationRunner({PostgresqlMigrationPlanner planner = const PostgresqlMigrationPlanner()})
Creates a PostgreSQL migration runner.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
planner PostgresqlMigrationPlanner
Planner used to compute schema transitions.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

ensureHistoryTable(SessionExecutor executor) Future<void>
Ensures the migration history table exists and contains all known columns.
loadActiveHistory(SessionExecutor executor) Future<List<PostgresqlMigrationRecord>>
Loads only the currently active apply records.
loadHistory(SessionExecutor executor) Future<List<PostgresqlMigrationRecord>>
Loads the full migration history ordered by application time.
markMigrationApplied({required SessionExecutor executor, required String migrationName, required int statementCount, required String checksum, required String beforeSchema, required String afterSchema, required List<String> warnings, required bool rebuildRequired}) Future<bool>
Inserts an apply record without executing schema statements.
markMigrationRolledBack({required SessionExecutor executor, required String migrationName, String? rollbackName}) Future<bool>
Inserts a rollback record without executing schema statements.
migrateToSchema({required SessionExecutor executor, required SchemaDocument target, required String migrationName, bool allowWarnings = false}) Future<PostgresqlMigrationResult>
Applies the schema diff to target and writes a history record.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pushToSchema({required SessionExecutor executor, required SchemaDocument target, bool allowWarnings = false}) Future<PostgresqlMigrationResult>
Applies the schema diff to target without writing migration history.
rollbackToSchema({required SessionExecutor executor, required SchemaDocument target, required String targetMigrationName, String? rollbackName, bool allowWarnings = false}) Future<PostgresqlRollbackResult>
Rolls migration history back to targetMigrationName.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

historyTableName → const String
Migration history table name.
providerName → const String
Provider name stored with history records and checksums.