The table object that change_table hands to its callback while statements are being recorded. It has the methods of a real table definition (the column types, remove, rename, timestamps and references), each of which records the matching statement (add_column, remove_column and so on) on its ActiveRecord::CommandRecorder.

Summary

Methods

Creates the object that change_table hands to its callback while statements are being recorded.
Records the addition of a reference column.
Records the removal of a column.
Records the renaming of a column.
Records the addition of the timestamp columns.

Methods

ActiveRecord.TableRecorder:init(recorder, table_name)

shared packages/active_record/lib/migrator/command_recorder.lua:306

Creates the object that change_table hands to its callback while statements are being recorded. It has the column type methods of a real table definition, as well as remove, rename, timestamps and references, and records each call as a statement.

Parameters

  • recorder ActiveRecord::CommandRecorder
  • table_name String

Returns

  • ActiveRecord::TableRecorder(self)

ActiveRecord.TableRecorder:references(name, ...)

shared packages/active_record/lib/migrator/command_recorder.lua:346

Records the addition of a reference column.

Parameters

  • name String/Map name of the referenced model, or the table form of the arguments
  • ... Vararg options

ActiveRecord.TableRecorder:remove(name)

shared packages/active_record/lib/migrator/command_recorder.lua:326

Records the removal of a column.

Parameters

  • name String column name

ActiveRecord.TableRecorder:rename(name, new_name)

shared packages/active_record/lib/migrator/command_recorder.lua:333

Records the renaming of a column.

Parameters

  • name String current column name
  • new_name String

ActiveRecord.TableRecorder:timestamps(options)

shared packages/active_record/lib/migrator/command_recorder.lua:339

Records the addition of the timestamp columns.

Parameters

  • options Map optional, defaults to nil column options

Defined in