class

Marten::DB::Management::Migrations::Runner

Inherits Reference < Object

Constants

PRE_INITIAL_MIGRATION_ID = "zero"

Constructors

new(connection : Connection::Base)
Source

Instance methods

execute(app_config : Apps::Config | Nil = nil, migration_name : String | Nil = nil, fake = false)

Executes the migrations up until the specified app config / migration name (if specified).

If no app config / migration name is specified, the method executes all the non-applied migrations.

Source
execute(app_config : Apps::Config | Nil = nil, migration_name : String | Nil = nil, fake = false, &)

Executes the migrations up until the specified app config / migration name (if specified).

If no app config / migration name is specified, the method executes all the non-applied migrations.

It should be noted that this method yields a Marten::DB::Management::Migrations::Runner::Progress object at each execution of a migration (before and after).

Source
execution_needed?(app_config : Apps::Config | Nil = nil, migration_name : String | Nil = nil) : Bool

Returns true if the execution of the runner is needed for the specified app config and migration name.

Source
mark_eligible_replacements_as_applied
Source
plan(app_config : Apps::Config | Nil = nil, migration_name : String | Nil = nil) : Array(Tuple(Migration, Bool))

Returns the migration plan for the specified app config and migration name.

This method returns an array of tuples containing (i) a migration to apply and (ii) a boolean indicating if the migration should be applied in a backward way.

Source
prune

Removes migration records from the database that no longer have a corresponding migration class.

Returns an array of tuples containing the app label and migration name of each pruned migration.

Raises Marten::DB::Management::Migrations::Errors::PruneConflict if a squashed migration still has a replaces attribute referencing migrations that would be pruned.

Source

Nested types