The inverters of the reversible schema statements, which
ActiveRecord::CommandRecorder#inverse_of looks up by the name of the statement. A
statement that has no inverter cannot be reverted automatically.
Statement name -> function that takes the arguments of the statement (a list with their count under 'n') and returns the inverse statement.
Summary
Functions
Functions
Inverts add_column into remove_column.
Parameters
- args
Inverts add_foreign_key into remove_foreign_key.
Parameters
- args
Inverts add_index into remove_index of the same columns. Understands both the positional and the table form of the arguments.
Parameters
- args
Inverts add_reference into remove_reference.
Parameters
- args
Inverts add_timestamps into remove_timestamps.
Parameters
- args
inverters.create_reference(args)
shared packages/active_record/lib/migrator/command_recorder.lua:191Inverts create_reference into remove_foreign_key of the reference's key.
Parameters
- args
Inverts create_table into drop_table. The table definition is kept, so that the drop_table can be inverted back.
Parameters
- args
Inverts define_model into a drop_table of the model's table.
Parameters
- args
Inverts drop_table into create_table, or into define_model for a model's table. Raises an error if the table definition is not given.
Parameters
- args
Inverts execute_block into itself: the block is run either way, and decides what to do from the direction of the migration.
Parameters
- args
Inverts remove_column into add_column. Raises an error if the type of the column is not given.
Parameters
- args
inverters.remove_foreign_key(args)
shared packages/active_record/lib/migrator/command_recorder.lua:182Inverts remove_foreign_key into add_foreign_key. Raises an error if the referenced table is not given.
Parameters
- args
Inverts remove_index into add_index. Raises an error if the column(s) of the index are not given.
Parameters
- args
inverters.remove_reference(args)
shared packages/active_record/lib/migrator/command_recorder.lua:129Inverts remove_reference into add_reference.
Parameters
- args
inverters.remove_timestamps(args)
shared packages/active_record/lib/migrator/command_recorder.lua:119Inverts remove_timestamps into add_timestamps.
Parameters
- args
Inverts rename_column by swapping the column names.
Parameters
- args
Inverts rename_table by swapping the names.
Parameters
- args