Module: PgSaurus::Migration::CommandRecorder::ViewMethods
- Included in:
- PgSaurus::Migration::CommandRecorder
- Defined in:
- lib/pg_saurus/migration/command_recorder/view_methods.rb
Overview
Provides methods to extend ActiveRecord::Migration::CommandRecorder to support view feature.
Instance Method Summary collapse
-
#create_view(*args) ⇒ view
Create a PostgreSQL view.
-
#drop_view(*args) ⇒ void
Drop a view in the DB.
-
#invert_create_view(args) ⇒ void
Invert the creation of a view in the DB.
Instance Method Details
#create_view(*args) ⇒ view
Create a PostgreSQL view.
9 10 11 |
# File 'lib/pg_saurus/migration/command_recorder/view_methods.rb', line 9 def create_view(*args) record(:create_view, args) end |
#drop_view(*args) ⇒ void
This method returns an undefined value.
Drop a view in the DB.
18 19 20 |
# File 'lib/pg_saurus/migration/command_recorder/view_methods.rb', line 18 def drop_view(*args) record(:drop_view, args) end |
#invert_create_view(args) ⇒ void
This method returns an undefined value.
Invert the creation of a view in the DB.
27 28 29 |
# File 'lib/pg_saurus/migration/command_recorder/view_methods.rb', line 27 def invert_create_view(args) [:drop_view, [args.first]] end |