class Marten::DB::Management::Migrations::Reader

Overview

Represents a migrations reader.

The migration reader will process all migrations defined by the available apps and all the migrations that were already applied (ie. recorded) for the existing database in order to build a corresponding directed acyclic graph of migrations.

Defined in:

marten/db/management/migrations/reader.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(connection : Connection::Base | Nil = nil) #

[View source]

Instance Method Detail

def applied_migrations : Hash(String, Marten::DB::Migration?) #

[View source]
def apps_with_migrations #

Returns an array of apps that have migrations defined.


[View source]
def get_migration(app_config : Apps::Config, migration_name : String) : Migration.class #

Returns a migration class for a specific app config and migration name.


[View source]

[View source]
def latest_migration(app_config : Apps::Config) : Migration.class | Nil #

Returns the latest migration class (if any) for a given app config.


[View source]
def replacements : Hash(String, Marten::DB::Migration) #

[View source]