class CommandRecorder
Ruby on Rails 8.1.2
Since v3.1.12Migration Command Recorder
ActiveRecord::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_exclusion_constraint
-
add_unique_constraint
-
add_index
-
add_reference
-
add_timestamps
-
change_column_default (must supply a
:fromand:tooption) -
change_column_null
-
change_column_comment (must supply a
:fromand:tooption) -
change_table_comment (must supply a
:fromand:tooption) -
create_enum
-
create_join_table
-
create_virtual_table
-
create_table
-
disable_extension
-
drop_enum (must supply a list of values)
-
drop_join_table
-
drop_virtual_table (must supply options)
-
drop_table (must supply a block)
-
enable_extension
-
remove_column (must supply a type)
-
remove_columns (must supply a
:typeoption) -
remove_foreign_key (must supply a second table)
-
remove_check_constraint
-
remove_exclusion_constraint
-
remove_unique_constraint
-
remove_index
-
remove_reference
-
remove_timestamps
-
rename_column
-
rename_enum
-
rename_enum_value (must supply a
:fromand:tooption) -
rename_index
-
rename_table
-
enable_index
-
disable_index
Inherits from
Constants
Attributes
Methods (defined here)
- # inverse_of
- # record
- # replay
- # revert
- self. new
Private methods
(28)
Implementation detail — not part of the public API.
- # invert_add_check_constraint
- # invert_add_foreign_key
- # invert_add_unique_constraint
- # invert_change_column_comment
- # invert_change_column_default
- # invert_change_column_null
- # invert_change_table_comment
- # invert_create_table
- # invert_disable_index
- # invert_drop_enum
- # invert_drop_table
- # invert_drop_virtual_table
- # invert_enable_index
- # invert_remove_check_constraint
- # invert_remove_column
- # invert_remove_columns
- # invert_remove_exclusion_constraint
- # invert_remove_foreign_key
- # invert_remove_index
- # invert_remove_unique_constraint
- # invert_rename_column
- # invert_rename_enum
- # invert_rename_enum_value
- # 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!
- # with
- # with_options
From ActiveSupport::NumericWithFormat (2)
- # to_formatted_s
- # to_fs