Class: PGTrunk::Operations::Triggers::DropTrigger
- Inherits:
-
Base
show all
- Defined in:
- lib/pg_trunk/operations/triggers/drop_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
70
71
72
73
|
# File 'lib/pg_trunk/operations/triggers/drop_trigger.rb', line 70
def invert
irreversible!("if_exists: true") if if_exists
CreateTrigger.new(**to_h)
end
|
#to_sql(_version) ⇒ Object
64
65
66
67
68
|
# File 'lib/pg_trunk/operations/triggers/drop_trigger.rb', line 64
def to_sql(_version)
sql = "DROP TRIGGER"
sql << " IF EXISTS" if if_exists
sql << " #{name.name.inspect} ON #{table.to_sql};"
end
|