class Athena::ORM::Migrations::Version::AliasResolver
inherits Reference
#
Resolves the version a command is given, which may be an alias, to the version of a migration.
| Alias | Resolves to |
|---|---|
first or 0 |
0, the version before the first migration |
current |
The last executed migration, or 0 if none were |
prev |
The executed migration before the last one, or 0 if there isn't one |
next |
The first migration that hasn't been executed |
latest |
The last available migration, or current if there are none |
current-N |
The Nth executed migration before the last one |
current+N |
The Nth migration after the last executed one that hasn't been executed |
Any other value is resolved as the version itself, i.e. a migration's fully qualified type name.
Constructors#
.new(migration_plan_calculator : AORM::Migrations::Version::MigrationPlanCalculator, metadata_storage : AORM::Migrations::Metadata::Storage::Interface, migration_status_calculator : AORM::Migrations::Version::MigrationStatusCalculator)#
Methods#
#resolve_version_alias(version_alias : String) : AORM::Migrations::Version#
Returns the version version_alias resolves to.
Raises AORM::Migrations::Exception::UnknownMigrationVersion if it doesn't resolve to one, and AORM::Migrations::Exception::NoMigrationsToExecute for next if every migration has been executed.
ameba:disable Metrics/CyclomaticComplexity