Class: PGTrunk::Operations::Triggers::RenameTrigger
- Inherits:
-
Base
show all
- Defined in:
- lib/pg_trunk/operations/triggers/rename_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
|
# File 'lib/pg_trunk/operations/triggers/rename_trigger.rb', line 70
def invert
self.class.new(**to_h, name: new_name, to: name)
end
|
#to_sql(_version) ⇒ Object
63
64
65
66
67
68
|
# File 'lib/pg_trunk/operations/triggers/rename_trigger.rb', line 63
def to_sql(_version)
<<~SQL.squish
ALTER TRIGGER #{name.name.inspect} ON #{table.to_sql}
RENAME TO #{new_name.name.inspect};
SQL
end
|