class

Lustra::Migration::Table

Inherits Lustra::Migration::FullTextSearchableTableHelpers < Lustra::Migration::Operation < Lustra::ErrorMessages < Reference < Object

Reopen Table to add the helpers

Constructors

new(name : String, schema : String, is_create : Bool)
Source

Instance methods

add_column(column, type, default = nil, null = true, primary = false, index = false, unique = false, array = false, comment : String | Nil = nil)

Add/alter a column for this table.

Source
add_fkey(fields : Array(String), table : String, foreign_fields : Array(String), on_delete : String, primary : Bool)
Source
column(name, type, default = nil, null = true, primary = false, index = false, unique = false, array = false, comment : String | Nil = nil)
Source
column_operations
Source
down
Source
fkey_operations
Source
full_name
Source
index(field : String | Symbol, name = nil, using = nil, unique = false)

Add or replace an index for this table. Alias for add_index

Source
index(fields : Array, name = nil, using = nil, unique = false)
Source
index_operations
Source
is_create?
Source
name
Source
references(to, name : String | Nil = nil, on_delete = "restrict", type = "bigint", null = false, foreign_key = "id", primary = false)
Source
schema
Source
timestamps(null = false)

Add the timestamps to the field.

Source

Macros

method_missing(caller)

DEPRECATED Method missing is used to generate add_column using the method name as column type (ActiveRecord's style)

Source

Nested types