class CommandRecorder
Ruby on Rails 6.1.7.10
Since v3.1.12ActiveRecord::Migration::CommandRecorder records commands done during a migration and knows how to reverse those commands. The CommandRecorder knows how to invert the following commands:
-
add_column
-
add_foreign_key
-
add_check_constraint
-
add_index
-
add_reference
-
add_timestamps
-
change_column
-
change_column_default (must supply a :from and :to option)
-
change_column_null
-
change_column_comment (must supply a :from and :to option)
-
change_table_comment (must supply a :from and :to option)
-
create_join_table
-
create_table
-
disable_extension
-
drop_join_table
-
drop_table (must supply a block)
-
enable_extension
-
remove_column (must supply a type)
-
remove_columns (must specify at least one column name or more)
-
remove_foreign_key (must supply a second table)
-
remove_check_constraint
-
remove_index
-
remove_reference
-
remove_timestamps
-
rename_column
-
rename_index
-
rename_table
Inherits from
Constants
Attributes
Methods (defined here)
- # inverse_of
- # record
- # replay
- # revert
- self. new
Private methods
(16)
Implementation detail — not part of the public API.
- # invert_change_column_comment
- # invert_change_column_default
- # invert_change_column_null
- # invert_change_table_comment
- # invert_drop_table
- # invert_remove_check_constraint
- # invert_remove_column
- # invert_remove_columns
- # invert_remove_foreign_key
- # invert_remove_index
- # invert_rename_column
- # invert_rename_index
- # invert_rename_table
- # invert_transaction
- # method_missing
- # respond_to_missing?
Methods (inherited)
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # unescape
- # with_options
From ActiveRecord::TestFixtures (4)
From ActiveSupport::Concern (3)
- # class_methods
- # included
- # prepended