Class: PGTrunk::Operations::Triggers::CreateTrigger
- Inherits:
-
Base
show all
- Defined in:
- lib/pg_trunk/operations/triggers/create_trigger.rb
Instance Method Summary
collapse
Methods inherited from Base
#<=>
#quote
#dump, #to_a, #to_opts, #to_ruby
#invert!, #irreversible!
#error_messages
#attributes, #initialize
Instance Method Details
#invert ⇒ Object
163
164
165
166
|
# File 'lib/pg_trunk/operations/triggers/create_trigger.rb', line 163
def invert
irreversible!("replace_existing: true") if replace_existing
DropTrigger.new(**to_h)
end
|
#to_sql(version) ⇒ Object
155
156
157
158
159
160
161
|
# File 'lib/pg_trunk/operations/triggers/create_trigger.rb', line 155
def to_sql(version)
[
create_trigger(version),
*,
register_trigger,
].join(" ")
end
|