class Athena::ORM::Migrations::Version::Executor
inherits Reference
#
Executes a single migration, and records it in the metadata storage.
Each execution runs in a transaction if the migration is AORM::Migrations::AbstractMigration#transactional?, which is rolled back if the migration fails or is skipped.
Constructors#
.new(metadata_storage : AORM::Migrations::Metadata::Storage::Interface, connection : AORM::Connection)#
Methods#
#add_sql(query : AORM::Migrations::Query) : Nil#
Adds query to the SQL of the migration being executed.
#execute(plan : AORM::Migrations::Metadata::MigrationPlan, configuration : AORM::Migrations::MigratorConfiguration) : AORM::Migrations::Version::ExecutionResult#
Executes the migration of plan in its direction, and returns the result.
A skipped migration, see AORM::Migrations::AbstractMigration#skip_if, returns a skipped result.
Re-raises anything else the migration raises, after rolling back its transaction.
#sql : Array(AORM::Migrations::Query)#
Returns the SQL of the migration being executed, and of the metadata storage during a dry run.