Class: ActiveRecord::ConnectionAdapters::IBM_DBAdapter::TableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::IBM_DBAdapter::TableDefinition
- Includes:
- ColumnMethods
- Defined in:
- lib/active_record/connection_adapters/ibm_db_adapter.rb
Instance Attribute Summary collapse
-
#exclusion_constraints ⇒ Object
readonly
Returns the value of attribute exclusion_constraints.
-
#unique_constraints ⇒ Object
readonly
Returns the value of attribute unique_constraints.
Instance Method Summary collapse
- #exclusion_constraint(expression, **options) ⇒ Object
-
#initialize ⇒ TableDefinition
constructor
A new instance of TableDefinition.
-
#new_unique_constraint_definition(column_name, options) ⇒ Object
:nodoc:.
- #unique_constraint(column_name, **options) ⇒ Object
Methods included from ColumnMethods
Constructor Details
#initialize ⇒ TableDefinition
Returns a new instance of TableDefinition.
870 871 872 873 874 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 870 def initialize(*, **) super @exclusion_constraints = [] @unique_constraints = [] end |
Instance Attribute Details
#exclusion_constraints ⇒ Object (readonly)
Returns the value of attribute exclusion_constraints.
868 869 870 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 868 def exclusion_constraints @exclusion_constraints end |
#unique_constraints ⇒ Object (readonly)
Returns the value of attribute unique_constraints.
868 869 870 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 868 def unique_constraints @unique_constraints end |
Instance Method Details
#exclusion_constraint(expression, **options) ⇒ Object
876 877 878 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 876 def exclusion_constraint(expression, **) exclusion_constraints << new_exclusion_constraint_definition(expression, ) end |
#new_unique_constraint_definition(column_name, options) ⇒ Object
:nodoc:
886 887 888 889 890 891 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 886 def new_unique_constraint_definition(column_name, ) # :nodoc: @conn.puts_log "TD new_unique_constraint_definition column_name = #{column_name}, options = #{}" @conn.puts_log caller = @conn.(name, column_name, ) UniqueConstraintDefinition.new(name, column_name, ) end |
#unique_constraint(column_name, **options) ⇒ Object
880 881 882 883 884 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 880 def unique_constraint(column_name, **) @conn.puts_log "TD unique_constraint column_name = #{column_name}, options = #{}" unique_constraints << new_unique_constraint_definition(column_name, ) @conn.puts_log "unique_constraints = #{unique_constraints}" end |