module Jennifer::Migration::Runner

Overview

This modules is responsible for processing database migration operations like creation, dropping and migration.

Defined in:

jennifer/migration/runner.cr

Class Method Summary

Class Method Detail

def self.create(adapter : Adapter::Base = default_adapter) #

Creates database using given adapter.

If database already exists - do nothing.

By default use application default adapter.


[View source]
def self.drop(adapter : Adapter::Base = default_adapter) #

Drops database using given adapter.

By default use application default adapter.


[View source]
def self.load_schema #

Loads schema from the SQL schema file.


[View source]
def self.migrate(count : Int = -1) #

Invokes migrations. count with negative or zero value will invoke all pending migrations.


[View source]
def self.pending_migration? #

Returns whether pending migration exists.

Pending migration - known Jennifer::Migration::Base subclasses that hasn't been run.


[View source]
def self.rollback(options : Hash(Symbol, DBAny)) #

Rollbacks migrations.

Allowed options:

  • count - count of migrations to be rolled back
  • to - migration timestamp to which database should be rolled back

[View source]