class Clear::Migration::Table
- Clear::Migration::Table
- Clear::Migration::Operation
- Reference
- Object
Overview
Reopen Table to add the helpers
Included Modules
Defined in:
clear/extensions/full_text_searchable/full_text_searchable.crclear/migration/operation/table.cr
Constructors
Instance Method Summary
-
#add_column(column, type, default = nil, null = true, primary = false, index = false, unique = false, array = false)
Add/alter a column for this table.
- #add_fkey(fields : Array(String), table : String, foreign_fields : Array(String), on_delete : String, primary : Bool)
- #column(name, type, default = nil, null = true, primary = false, index = false, unique = false, array = false)
- #column_operations : Array(ColumnOperation)
- #down : Array(String)
- #fkey_operations : Array(FkeyOperation)
- #full_name
-
#index(field : String | Symbol, name = nil, using = nil, unique = false)
Add or replace an index for this table.
- #index(fields : Array, name = nil, using = nil, unique = false)
- #index_operations : Array(IndexOperation)
- #is_create? : Bool
- #name : String
- #references(to, name : String | Nil = nil, on_delete = "restrict", type = "bigint", null = false, foreign_key = "id", primary = false)
- #schema : String
-
#timestamps(null = false)
Add the timestamps to the field.
- #up : Array(String)
Macro Summary
-
method_missing(caller)
DEPRECATED Method missing is used to generate add_column using the method name as column type (ActiveRecord's style)
Instance methods inherited from module Clear::Migration::FullTextSearchableTableHelpers
full_text_searchable(on : Array(Tuple(String, Char)), column_name = "full_text_vector", catalog = "pg_catalog.english", trigger_name = nil, function_name = nil)full_text_searchable(on : String, column_name = "full_text_vector", catalog = "pg_catalog.english", trigger_name = nil, function_name = nil)
full_text_searchable(on : Array(String), column_name = "full_text_vector", catalog = "pg_catalog.english", trigger_name = nil, function_name = nil) full_text_searchable
Instance methods inherited from class Clear::Migration::Operation
down : Array(String)
down,
irreversible!(operation_name : String | Nil = nil)
irreversible!,
migration : Clear::Migration | Nil
migration,
migration=(migration : Clear::Migration | Nil)
migration=,
up : Array(String)
up
Instance methods inherited from module Clear::ErrorMessages
build_error_message(message : String, ways_to_resolve : Tuple | Array = Tuple.new, manual_pages : Tuple | Array = Tuple.new)
build_error_message,
converter_error(from, to)
converter_error,
format_width(x, w = 80)
format_width,
illegal_setter_access_to_undefined_column(name)
illegal_setter_access_to_undefined_column,
lack_of_primary_key(model_name)
lack_of_primary_key,
migration_already_down(number)
migration_already_down,
migration_already_up(number)
migration_already_up,
migration_irreversible(name = nil, operation = nil)
migration_irreversible,
migration_not_found(number)
migration_not_found,
migration_not_unique(numbers)
migration_not_unique,
no_migration_yet(version)
no_migration_yet,
null_column_mapping_error(name, type)
null_column_mapping_error,
order_by_error_invalid_order(current_order)
order_by_error_invalid_order,
polymorphic_nil(through)
polymorphic_nil,
polymorphic_unknown_class(class_name)
polymorphic_unknown_class,
query_building_error(message)
query_building_error,
uid_not_found(class_name)
uid_not_found,
uninitialized_db_connection(connection)
uninitialized_db_connection
Constructor Detail
Instance Method Detail
def add_column(column, type, default = nil, null = true, primary = false, index = false, unique = false, array = false)
#
Add/alter a column for this table.
def add_fkey(fields : Array(String), table : String, foreign_fields : Array(String), on_delete : String, primary : Bool)
#
def column(name, type, default = nil, null = true, primary = false, index = false, unique = false, array = false)
#
Add or replace an index for this table.
Alias for add_index
def references(to, name : String | Nil = nil, on_delete = "restrict", type = "bigint", null = false, foreign_key = "id", primary = false)
#
Macro Detail
macro method_missing(caller)
#
DEPRECATED Method missing is used to generate add_column using the method name as column type (ActiveRecord's style)