Class: Nandi::Instructions::AddCheckConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/nandi/instructions/add_check_constraint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table:, name:, check:) ⇒ AddCheckConstraint

Returns a new instance of AddCheckConstraint.



8
9
10
11
12
# File 'lib/nandi/instructions/add_check_constraint.rb', line 8

def initialize(table:, name:, check:)
  @table = table
  @name = name
  @check = check
end

Instance Attribute Details

#checkObject (readonly)

Returns the value of attribute check.



6
7
8
# File 'lib/nandi/instructions/add_check_constraint.rb', line 6

def check
  @check
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/nandi/instructions/add_check_constraint.rb', line 6

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



6
7
8
# File 'lib/nandi/instructions/add_check_constraint.rb', line 6

def table
  @table
end

Instance Method Details

#lockObject



18
19
20
# File 'lib/nandi/instructions/add_check_constraint.rb', line 18

def lock
  Nandi::Migration::LockWeights::ACCESS_EXCLUSIVE
end

#procedureObject



14
15
16
# File 'lib/nandi/instructions/add_check_constraint.rb', line 14

def procedure
  :add_check_constraint
end