abstract class Avram::Migrator::Migration::V1

Included Modules

Defined in:

avram/migrator/migration.cr

Instance Method Summary

Instance methods inherited from module Avram::Migrator::StatementHelpers

create_foreign_key(from : Symbol, to : Symbol, on_delete : Symbol, column : Symbol | Nil, primary_key = :id) create_foreign_key, create_index(table_name : Symbol, columns : Columns, unique = false, using = :btree) create_index, drop(table_name) drop, drop_index(table_name : Symbol, columns : Columns, if_exists = false, on_delete = :do_nothing) drop_index, make_optional(table : Symbol, column : Symbol) make_optional, make_required(table : Symbol, column : Symbol) make_required

Instance methods inherited from module Avram::Migrator::IndexStatementHelpers

add_index(column : Symbol, unique = false, using : Symbol = :btree) add_index, index_added?(index : String, column : Symbol) index_added?

Instance methods inherited from class Object

blank_for_validates_required? : Bool blank_for_validates_required?

Instance Method Detail

def down(quiet = false) #

Same as #up except calls rollback method in migration.


[View source]
abstract def migrate #

[View source]
def migrated? #

[View source]
def pending? #

[View source]
def prepared_statements : Array(String) #

[View source]
def reset_prepared_statements #

[View source]
def up(quiet = false) #

Unless already migrated, calls migrate which in turn calls statement helpers to generate and collect SQL statements in the @prepared_statements array. Each statement is then executed in a transaction and tracked upon completion.


[View source]
abstract def version #

[View source]