ActiveRecord.Queue class
Part of Active Record
Holds the table definitions made with ActiveRecord.define_model before ActiveRecord
is ready. The column type calls of each definition are recorded instead of run, and
run creates the tables once the stored schema has been restored from the database.
Summary
Methods
Records a table definition, so that the table can be created later by #run.
add_type(type)shared
Registers a column type, so that it can be used in queued table definitions.
run()shared
Creates every table that was recorded with #add and clears the queue.
Methods
ActiveRecord.Queue:add(table_name, callback)
shared packages/active_record/lib/database/queue.lua:14Records a table definition, so that the table can be created later by #run.
Parameters
- table_name String
- callback Function receives an object with a method for every column type (t:string, t:integer, ...) that records the call instead of running it
Registers a column type, so that it can be used in queued table definitions.
Parameters
- type String abstract column type, e.g. 'string'
Creates every table that was recorded with #add and clears the queue.