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.


58
# File 'lib/schema_plus.rb', line 58

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.


65
# File 'lib/schema_plus.rb', line 65

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.


83
# File 'lib/schema_plus.rb', line 83

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.


74
# File 'lib/schema_plus.rb', line 74

has_value :on_update