column_exists?

column_exists?(column_name, type = nil, options = {}) Instance Public methods Checks to see if a column exists. See ActiveRecord::ConnectionAdapters::SchemaStatements#column_exists?

index

index(column_name, options = {}) Instance Public methods Adds a new index to the table. column_name can be a single Symbol, or an Array of Symbols. See ActiveRecord::ConnectionAdapters::SchemaStatements#add_index Creating a simple index t.index(:name) Creating a unique index t.index([:branch_id, :party_id], unique: true) Creating a named index t.index([:branch_id, :party_id], unique: true, name: 'by_branch_party')

index_exists?

index_exists?(column_name, options = {}) Instance Public methods Checks to see if an index exists. See ActiveRecord::ConnectionAdapters::SchemaStatements#index_exists?

references

references(*args) Instance Public methods Adds a reference. Optionally adds a type column, if :polymorphic option is provided. references and belongs_to are acceptable. t.references(:user) t.belongs_to(:supplier, polymorphic: true) belongs_to

remove

remove(*column_names) Instance Public methods Removes the column(s) from the table definition. t.remove(:qualification) t.remove(:qualification, :experience)

remove_belongs_to

remove_belongs_to(*args) Instance Public methods Alias for: remove_references

remove_index

remove_index(options = {}) Instance Public methods Removes the given index from the table. Remove the index_table_name_on_column in the table_name table t.remove_index :column Remove the index named index_table_name_on_branch_id in the table_name table t.remove_index column: :branch_id Remove the index named index_table_name_on_branch_id_and_party_id in the table_name table t.remove_index column: [:branch_id, :party_id] Remove the index named by_branch_party in the table_name ta

remove_references

remove_references(*args) Instance Public methods Removes a reference. Optionally removes a type column. remove_references and remove_belongs_to are acceptable. t.remove_references(:user) t.remove_belongs_to(:supplier, polymorphic: true) remove_belongs_to

remove_timestamps

remove_timestamps() Instance Public methods Removes the timestamp columns (created_at and updated_at) from the table. t.remove_timestamps

rename

rename(column_name, new_column_name) Instance Public methods Renames a column. t.rename(:description, :name)