Class: SchemaPlus::Config::ForeignKeys
- Inherits:
-
Valuable
- Object
- Valuable
- SchemaPlus::Config::ForeignKeys
- Defined in:
- lib/schema_plus.rb
Overview
This set of configuration options control SchemaPlus’s foreign key constraint behavior. Set them in config/initializers/schema_plus.rb
using:
SchemaPlus.setup do |config|
config.foreign_keys.auto_create = ...
end
Instance Method Summary collapse
-
#auto_create ⇒ Object
:attr_accessor: auto_create.
-
#auto_index ⇒ Object
:attr_accessor: auto_index.
-
#on_delete ⇒ Object
:attr_accessor: on_delete.
-
#on_update ⇒ Object
:attr_accessor: on_update.
Instance Method Details
#auto_create ⇒ Object
:attr_accessor: auto_create
Whether to automatically create foreign key constraints for columns suffixed with _id
. Boolean, default is true
.
56 |
# File 'lib/schema_plus.rb', line 56 has_value :auto_create, :klass => :boolean, :default => true |
#auto_index ⇒ Object
:attr_accessor: auto_index
Whether to automatically create indexes when creating foreign key constraints for columns. Boolean, default is true
.
63 |
# File 'lib/schema_plus.rb', line 63 has_value :auto_index, :klass => :boolean, :default => true |
#on_delete ⇒ Object
:attr_accessor: on_delete
The default value for :on_delete
when creating foreign key constraints for columns. Valid values are as described in ForeignKeyDefinition, or nil
to let the database connection use its own default. Default is nil
.
81 |
# File 'lib/schema_plus.rb', line 81 has_value :on_delete |
#on_update ⇒ Object
:attr_accessor: on_update
The default value for :on_update
when creating foreign key constraints for columns. Valid values are as described in ForeignKeyDefinition, or nil
to let the database connection use its own default. Default is nil
.
72 |
# File 'lib/schema_plus.rb', line 72 has_value :on_update |