PostgresqlMigrationService class

High-level PostgreSQL migration orchestration service.

Constructors

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

Properties

hashCode int
The hash code for this object.
no setterinherited
planner PostgresqlMigrationPlanner
Planner used to create migration plans.
final
runner PostgresqlMigrationRunner
Runner used to apply, rollback, and inspect migrations.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

applySchema({required SessionExecutor executor, required SchemaDocument target, required String migrationName, bool allowWarnings = false}) Future<PostgresqlMigrationResult>
Applies target to the database and records the migration result.
deployMigrations({required SessionExecutor executor, required String migrationsDirectory}) Future<DeployResult>
Applies all pending local migrations in order.
draftFromDatabase({required SessionExecutor executor, required SchemaDocument target, required String migrationName}) Future<PostgresqlMigrationDraft>
Creates a migration draft by diffing the live database against target.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pushSchema({required SessionExecutor executor, required SchemaDocument target, bool allowWarnings = false}) Future<PostgresqlMigrationResult>
Applies target directly without creating history entries.
resolveApplied({required SessionExecutor executor, required String migrationsDirectory, required String migrationName}) Future<ResolveResult>
Marks a local migration as already applied without executing SQL.
resolveRolledBack({required SessionExecutor executor, required String migrationName}) Future<ResolveResult>
Marks an active migration as rolled back without executing SQL.
rollbackMigration({required SessionExecutor executor, required String migrationsDirectory, String? migrationName, String? rollbackName, bool allowWarnings = false}) Future<PostgresqlRollbackResult>
Rolls back a migration using stored or on-disk schema snapshots.
status({required SessionExecutor executor, required String migrationsDirectory}) Future<PostgresqlMigrationStatus>
Compares database history with local migration artifacts.
toString() String
A string representation of this object.
inherited
writeDraft({required PostgresqlMigrationDraft draft, required String directoryPath}) Directory
Writes a draft to a migration directory on disk.

Operators

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