instance method
define
Ruby on Rails 8.0.4
Since v7.0.10Signature
define(info = {}, &block)
Eval the given block. All methods available to the current connection adapter are available within the block, so you can easily use the database definition DSL to build up your schema ( create_table, add_index, etc.).
The info hash is optional, and if given is used to define metadata about the current schema (currently, only the schema’s version):
ActiveRecord::Schema[7.0].define(version: 2038_01_19_000001) do ... end
Parameters
-
infoopt = {} -
blockblock
Source
# File activerecord/lib/active_record/schema.rb, line 49
def define(info = {}, &block)
new.define(info, &block)
end
Defined in activerecord/lib/active_record/schema.rb line 49
· View on GitHub
· Improve this page
· Find usages on GitHub