class Marten::DB::Management::TableState
- Marten::DB::Management::TableState
- Reference
- Object
Overview
Represents the state of a specific table at a specific step in a migration plan.
Defined in:
marten/db/management/table_state.crConstructors
Class Method Summary
-
.from_model(model : Model.class)
Initializes a table state from a specific model class.
- .gen_id(app_label : String, table_name : String)
Instance Method Summary
- #add_column(column : Column::Base) : Nil
- #add_index(index : Management::Index) : Nil
- #add_unique_constraint(unique_constraint : Management::Constraint::Unique) : Nil
- #app_label : String
- #change_column(column : Column::Base) : Nil
- #clone
- #columns : Array(Marten::DB::Management::Column::Base)
- #get_column(name : String) : Column::Base
- #get_index(name : String) : Management::Index
- #get_unique_constraint(name : String) : Management::Constraint::Unique
- #id : String
- #indexes : Array(Marten::DB::Management::Index)
- #name : String
- #name=(name : String)
- #remove_column(column : Column::Base)
- #remove_column(column_name : String)
- #remove_index(index : Management::Index) : Nil
- #remove_unique_constraint(unique_constraint : Management::Constraint::Unique) : Nil
- #rename_column(old_name : String, new_name : String)
- #unique_constraints : Array(Marten::DB::Management::Constraint::Unique)
Constructor Detail
def self.new(app_label : String, name : String, columns : Array(Column::Base), unique_constraints : Array(Management::Constraint::Unique) = [] of Management::Constraint::Unique, indexes : Array(Management::Index) = [] of Management::Index)
#
Class Method Detail
Initializes a table state from a specific model class.
Instance Method Detail
def remove_unique_constraint(unique_constraint : Management::Constraint::Unique) : Nil
#