Class: PGTrunk::Operations::Functions::ChangeFunction
- Inherits:
-
Base
show all
- Defined in:
- lib/pg_trunk/operations/functions/change_function.rb
Instance Method Summary
collapse
#quote
#dump, #to_a, #to_opts, #to_ruby
#invert!, #irreversible!
#error_messages
#attributes, #initialize
Instance Method Details
#invert ⇒ Object
72
73
74
75
76
77
78
79
80
|
# File 'lib/pg_trunk/operations/functions/change_function.rb', line 72
def invert
irreversible!("if_exists: true") if if_exists
undefined = inversion.select { |_, v| v.nil? }.keys.join(", ").presence
raise IrreversibleMigration.new(self, nil, <<~MSG.squish) if undefined
Undefined values to revert #{undefined}.
MSG
self.class.new(**inversion, name: name)
end
|
#to_sql(server_version) ⇒ Object
67
68
69
70
|
# File 'lib/pg_trunk/operations/functions/change_function.rb', line 67
def to_sql(server_version)
create_function&.to_sql(server_version)
end
|