Class: ActiveRecord::ConnectionAdapters::IBM_DBAdapter::AlterTable

Inherits:
AlterTable
  • Object
show all
Defined in:
lib/active_record/connection_adapters/ibm_db_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(td) ⇒ AlterTable

Returns a new instance of AlterTable.



847
848
849
850
851
852
853
854
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 847

def initialize(td)
  super
  @constraint_validations = []
  @exclusion_constraint_adds = []
  @exclusion_constraint_drops = []
  @unique_constraint_adds = []
  @unique_constraint_drops = []
end

Instance Attribute Details

#constraint_validationsObject (readonly)

Returns the value of attribute constraint_validations.



846
847
848
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 846

def constraint_validations
  @constraint_validations
end

#exclusion_constraint_addsObject (readonly)

Returns the value of attribute exclusion_constraint_adds.



846
847
848
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 846

def exclusion_constraint_adds
  @exclusion_constraint_adds
end

#exclusion_constraint_dropsObject (readonly)

Returns the value of attribute exclusion_constraint_drops.



846
847
848
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 846

def exclusion_constraint_drops
  @exclusion_constraint_drops
end

#unique_constraint_addsObject (readonly)

Returns the value of attribute unique_constraint_adds.



846
847
848
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 846

def unique_constraint_adds
  @unique_constraint_adds
end

#unique_constraint_dropsObject (readonly)

Returns the value of attribute unique_constraint_drops.



846
847
848
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 846

def unique_constraint_drops
  @unique_constraint_drops
end

Instance Method Details

#add_unique_constraint(column_name, options) ⇒ Object



856
857
858
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 856

def add_unique_constraint(column_name, options)
  @unique_constraint_adds << @td.new_unique_constraint_definition(column_name, options)
end

#drop_unique_constraint(unique_constraint_name) ⇒ Object



860
861
862
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 860

def drop_unique_constraint(unique_constraint_name)
  @unique_constraint_drops << unique_constraint_name
end