跳至内容 跳至搜索

Active Record PostgreSQL 适配器表定义

方法
E
N
U
包含的模块

属性

[R] exclusion_constraints
[R] unique_constraints
[R] unlogged

类公共方法

new(*, **)

# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 248
def initialize(*, **)
  super
  @exclusion_constraints = []
  @unique_constraints = []
  @unlogged = ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.create_unlogged_tables
end

实例公共方法

exclusion_constraint(expression, **options)

# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 255
def exclusion_constraint(expression, **options)
  exclusion_constraints << new_exclusion_constraint_definition(expression, options)
end

unique_constraint(column_name, **options)

# File activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb, line 259
def unique_constraint(column_name, **options)
  unique_constraints << new_unique_constraint_definition(column_name, options)
end