class

Ralph::Migrations::Migration

Inherits Reference / Object

Represents a parsed SQL migration file

Constructors

from_file(filepath : String) : Migration

Parse a migration file from disk

Source
new(version : String, name : String, filepath : String, up_statements : Array(String) = [] of String, down_statements : Array(String) = [] of String, no_transaction : Bool = false)
Source

Instance methods

<=>(other : Migration)

Comparison for sorting (by version)

Source
down_sql

Get combined down SQL (for display/debugging)

Source
down_statements

SQL statements for the down migration

Source
filepath

Full path to the .sql file

Source
has_down?

Check if migration has down statements

Source
has_up?

Check if migration has up statements

Source
name

The migration name (derived from filename)

Source
no_transaction?

Whether to run outside a transaction

Source
up_sql

Get combined up SQL (for display/debugging)

Source
up_statements

SQL statements for the up migration

Source
version

The migration version (timestamp from filename)

Source