Class: PgMeta::PrimaryKeyConstraint
- Inherits:
-
Constraint
- Object
- Node
- Constraint
- PgMeta::PrimaryKeyConstraint
- Defined in:
- lib/pg_meta/meta.rb
Instance Attribute Summary
Attributes inherited from Constraint
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(table, name, columns) ⇒ PrimaryKeyConstraint
constructor
A new instance of PrimaryKeyConstraint.
Methods inherited from Constraint
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 |