class ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition
Active Record PostgreSQL Adapter Table Definition
Inherits From
-
class
ActiveRecord::
ConnectionAdapters:: TableDefinition -
module
ActiveRecord::
ConnectionAdapters:: PostgreSQL:: ColumnMethods
Attributes
[R] | exclusion_constraints |
|
[R] | unique_constraints |
|
[R] | unlogged |
Public class methods
Source code GitHub
# 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
Public instance methods
Source code GitHub
# 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
Source code GitHub
# 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