123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::PostgreSQL::AlterTable

Relationships & Source Files
Inherits: ActiveRecord::ConnectionAdapters::AlterTable
  • ::Object
Defined in: activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb

Overview

Active Record PostgreSQL Adapter Alter Table

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(td) ⇒ AlterTable

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 365

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

Instance Attribute Details

#constraint_validations (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 363

attr_reader :constraint_validations, :exclusion_constraint_adds, :unique_constraint_adds

#exclusion_constraint_adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 363

attr_reader :constraint_validations, :exclusion_constraint_adds, :unique_constraint_adds

#unique_constraint_adds (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 363

attr_reader :constraint_validations, :exclusion_constraint_adds, :unique_constraint_adds

Instance Method Details

#add_exclusion_constraint(expression, options)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 376

def add_exclusion_constraint(expression, options)
  @exclusion_constraint_adds << @td.new_exclusion_constraint_definition(expression, options)
end

#add_unique_constraint(column_name, options)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 380

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

#validate_constraint(name)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 372

def validate_constraint(name)
  @constraint_validations << name
end