module PgSaurus::Migration::CommandRecorder::FunctionMethods

Methods to extend ActiveRecord::Migration::CommandRecorder to support database functions.

Public Instance Methods

create_function(*args) click to toggle source

:nodoc

# File lib/pg_saurus/migration/command_recorder/function_methods.rb, line 6
def create_function(*args)
  record :create_function, args
end
drop_function(*args) click to toggle source

:nodoc

# File lib/pg_saurus/migration/command_recorder/function_methods.rb, line 11
def drop_function(*args)
  record :drop_function, args
end
invert_create_function(args) click to toggle source

:nodoc

# File lib/pg_saurus/migration/command_recorder/function_methods.rb, line 16
def invert_create_function(args)
  function_name = args.first
  schema        = args.last[:schema]

  [:drop_function, [function_name, { schema: schema }]]
end