Class: Nandi::Instructions::AddForeignKey
- Inherits:
-
Object
- Object
- Nandi::Instructions::AddForeignKey
- Defined in:
- lib/nandi/instructions/add_foreign_key.rb
Instance Attribute Summary collapse
-
#table ⇒ Object
readonly
Returns the value of attribute table.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #extra_args ⇒ Object
-
#initialize(table:, target:, name: nil, **extra_args) ⇒ AddForeignKey
constructor
A new instance of AddForeignKey.
- #lock ⇒ Object
- #procedure ⇒ Object
Constructor Details
#initialize(table:, target:, name: nil, **extra_args) ⇒ AddForeignKey
Returns a new instance of AddForeignKey.
10 11 12 13 14 15 |
# File 'lib/nandi/instructions/add_foreign_key.rb', line 10 def initialize(table:, target:, name: nil, **extra_args) @table = table @target = target @extra_args = extra_args @name = name end |
Instance Attribute Details
#table ⇒ Object (readonly)
Returns the value of attribute table.
8 9 10 |
# File 'lib/nandi/instructions/add_foreign_key.rb', line 8 def table @table end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
8 9 10 |
# File 'lib/nandi/instructions/add_foreign_key.rb', line 8 def target @target end |
Instance Method Details
#extra_args ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/nandi/instructions/add_foreign_key.rb', line 21 def extra_args { **@extra_args, name: name, validate: false, }.compact end |
#lock ⇒ Object
29 30 31 |
# File 'lib/nandi/instructions/add_foreign_key.rb', line 29 def lock Nandi::Migration::LockWeights::ACCESS_EXCLUSIVE end |
#procedure ⇒ Object
17 18 19 |
# File 'lib/nandi/instructions/add_foreign_key.rb', line 17 def procedure :add_foreign_key end |