跳到内容 跳到搜索

Active Record PostgreSQL 适配器 Alter Table

方法
A
N
V

属性

[R] constraint_validations
[R] exclusion_constraint_adds
[R] unique_constraint_adds

类公共方法

new(td)

# 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

实例公共方法

add_exclusion_constraint(expression, options)

# 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)

# 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)

# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 372
def validate_constraint(name)
  @constraint_validations << name
end