module PgPower::Migration::CommandRecorder::ViewMethods
Provides methods to extend ActiveRecord::Migration::CommandRecorder to support view feature.
Public Instance Methods
create_view(*args)
click to toggle source
Create a PostgreSQL view.
@param args [Array] view_name and view_definition
@return [view]
# File lib/pg_power/migration/command_recorder/view_methods.rb, line 9 def create_view(*args) record(:create_view, args) end
drop_view(*args)
click to toggle source
Drop a view in the DB.
@param args [Array] first argument is view_name
@return [void]
# File lib/pg_power/migration/command_recorder/view_methods.rb, line 18 def drop_view(*args) record(:drop_view, args) end
invert_create_view(args)
click to toggle source
Invert the creation of a view in the DB.
@param args [Array] first argument is supposed to be name of view
@return [void]
# File lib/pg_power/migration/command_recorder/view_methods.rb, line 27 def invert_create_view(args) [:drop_view, [args.first]] end