table_exists?

table_exists?(table_name) Instance Public methods Checks to see if the table table_name exists on the database. table_exists?(:developers)

table_alias_for

table_alias_for(table_name) Instance Public methods Truncates a table alias according to the limits of the current adapter.

rename_table

rename_table(table_name, new_name) Instance Public methods Renames a table. rename_table('octopuses', 'octopi')

rename_index

rename_index(table_name, old_name, new_name) Instance Public methods Renames an index. Rename the index_people_on_last_name index to index_users_on_last_name: rename_index :people, 'index_people_on_last_name', 'index_users_on_last_name'

rename_column

rename_column(table_name, column_name, new_column_name) Instance Public methods Renames a column. rename_column(:suppliers, :description, :name)

remove_timestamps

remove_timestamps(table_name) Instance Public methods Removes the timestamp columns (created_at and updated_at) from the table definition. remove_timestamps(:suppliers)

remove_reference

remove_reference(table_name, ref_name, options = {}) Instance Public methods Removes the reference(s). Also removes a type column if one exists. remove_reference, remove_references and remove_belongs_to are acceptable. Remove the reference remove_reference(:products, :user, index: true) Remove polymorphic reference remove_reference(:products, :supplier, polymorphic: true) remove_belongs_to

remove_index

remove_index(table_name, options = {}) Instance Public methods Removes the given index from the table. Removes the index_accounts_on_column in the accounts table. remove_index :accounts, :column Removes the index named index_accounts_on_branch_id in the accounts table. remove_index :accounts, column: :branch_id Removes the index named index_accounts_on_branch_id_and_party_id in the accounts table. remove_index :accounts, column: [:branch_id, :party_id] Removes the index named by

remove_columns

remove_columns(table_name, *column_names) Instance Public methods Removes the given columns from the table definition. remove_columns(:suppliers, :qualification, :experience)

remove_column

remove_column(table_name, column_name, type = nil, options = {}) Instance Public methods Removes the column from the table definition. remove_column(:suppliers, :qualification) The type and options parameters will be ignored if present. It can be helpful to provide these in a migration's change method so it can be reverted. In that case, type and options will be used by add_column.