Skip to content

class Athena::ORM::Migrations::MigrationsRepository
inherits Reference #

Provides the migrations that can be executed, keyed by their version.

repository = AORM::Migrations::MigrationsRepository.new [
  App::Migrations::Version20261014120000,
  App::Migrations::Version20261015090000,
] of AORM::Migrations::AbstractMigration.class

repository.has_migration? AORM::Migrations::Version.new("App::Migrations::Version20261014120000") # => true

Constructors#

.new(migration_classes : Enumerable(AORM::Migrations::AbstractMigration.class))#

Raises AORM::Migrations::Exception::DuplicateMigrationVersion if migration_classes contains the same type more than once.

View source

Methods#

#has_migration?(version : AORM::Migrations::Version) : Bool#

Returns true if there is a migration with the provided version.

View source

#migration(version : AORM::Migrations::Version) : AORM::Migrations::Metadata::AvailableMigration#

Returns the migration with the provided version.

Raises AORM::Migrations::Exception::MigrationClassNotFound if there isn't one.

View source

#migrations : AORM::Migrations::Metadata::AvailableMigrationsSet#

Returns all the migrations.

View source