Class: PgMeta::PrimaryKeyConstraint

Inherits:
Constraint show all
Defined in:
lib/pg_meta/meta.rb

Instance Attribute Summary

Attributes inherited from Constraint

#columns

Attributes inherited from Node

#name, #parent, #root

Instance Method Summary collapse

Methods inherited from Constraint

#column, #kind, #to_h

Methods inherited from Node

#dump, #dump_value, #guid, #inspect, #sid, #to_h, #to_s, #to_yaml, #uid

Constructor Details

#initialize(table, name, columns) ⇒ PrimaryKeyConstraint

Returns a new instance of PrimaryKeyConstraint.



448
449
450
451
452
# File 'lib/pg_meta/meta.rb', line 448

def initialize(table, name, columns)
  super
  columns.each { |c| c.table.primary_key_columns << c }
  table.primary_key_constraints << self
end