Class: SchemaPlus::Config::ForeignKeys

Inherits:
Valuable
  • Object
show all
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

Instance Method Details

#auto_createObject

: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_indexObject

: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_deleteObject

: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_updateObject

: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