class Avram::Migrator::Runner

Extended Modules

Defined in:

avram/migrator/runner.cr

Constant Summary

MIGRATIONS_TABLE_NAME = "migrations"

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

blank_for_validates_required? : Bool blank_for_validates_required?

Constructor Detail

def self.new(quiet : Bool = false) #

[View source]

Class Method Detail

def self.cmd_args #

[View source]
def self.cmd_args_array : Array(String) #

Returns the DB connection args used for postgres in an array so you can pass them to Process.run


[View source]
def self.create_db(quiet? : Bool = false) #

[View source]
def self.credentials #

[View source]
def self.db_host #

[View source]
def self.db_name #

[View source]
def self.db_password #

[View source]
def self.db_port #

[View source]
def self.db_user #

[View source]
def self.drop_db(quiet? : Bool = false) #

[View source]
def self.dump_db(dump_to : String = "db/structure.sql", quiet : Bool = false) #

Creates a new file at dump_to with your database schema, and includes the migtation data.


[View source]
def self.migrations #

[View source]
def self.restore_db(restore_file : String, quiet : Bool = false) #

[View source]
def self.run(command : String, output : IO = STDOUT, input : Process::Stdio = Process::Redirect::Close) #

DEPRECATED Calling run with a single string is deprecated. Pass the args as a separate Array


[View source]
def self.run(command : String, args : Array(String), output : IO = STDOUT, input : Process::Stdio = Process::Redirect::Close) #

[View source]
def self.setup_migration_tracking_tables #

[View source]

Instance Method Detail

def ensure_migrated! #

[View source]
def rollback_all #

[View source]
def rollback_one #

[View source]
def rollback_to(last_version : Int64) #

[View source]
def run_next_migration #

[View source]
def run_pending_migrations #

[View source]