ActiveRecord.TableRecorder class
Part of Active Record
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.
references(name, ...)shared
Records the addition of a reference column.
remove(name)shared
Records the removal of a column.
rename(name, new_name)shared
Records the renaming of a column.
timestamps(options)shared
Records the addition of the timestamp columns.
Methods
ActiveRecord.TableRecorder:init(recorder, table_name)
shared packages/active_record/lib/migrator/command_recorder.lua:306Creates 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:346Records 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:326Records 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:333Records 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:339Records the addition of the timestamp columns.
Parameters
- options Map optional, defaults to
nilcolumn options