Class: PgHaMigrations::CheckConstraint

Inherits:
Struct
  • Object
show all
Defined in:
lib/pg_ha_migrations/constraint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, definition, validated) ⇒ CheckConstraint

Returns a new instance of CheckConstraint.



2
3
4
5
6
7
# File 'lib/pg_ha_migrations/constraint.rb', line 2

def initialize(name, definition, validated)
  # pg_get_constraintdef includes NOT VALID in the definition,
  # but we return that as a separate attribute.
  definition = definition&.gsub(/ NOT VALID\Z/, "")
  super(name, definition, validated)
end

Instance Attribute Details

#definitionObject

Returns the value of attribute definition

Returns:

  • (Object)

    the current value of definition



1
2
3
# File 'lib/pg_ha_migrations/constraint.rb', line 1

def definition
  @definition
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



1
2
3
# File 'lib/pg_ha_migrations/constraint.rb', line 1

def name
  @name
end

#validatedObject

Returns the value of attribute validated

Returns:

  • (Object)

    the current value of validated



1
2
3
# File 'lib/pg_ha_migrations/constraint.rb', line 1

def validated
  @validated
end