Class: PGTrunk::Operations::MaterializedViews::RenameMaterializedView
- Inherits:
-
Base
show all
- Defined in:
- lib/pg_trunk/operations/materialized_views/rename_materialized_view.rb
Instance Method Summary
collapse
Methods inherited from Base
#column
#quote
#dump, #to_a, #to_opts, #to_ruby
#invert!, #irreversible!
#error_messages
#attributes, #initialize
Instance Method Details
#invert ⇒ Object
44
45
46
47
|
# File 'lib/pg_trunk/operations/materialized_views/rename_materialized_view.rb', line 44
def invert
irreversible!("if_exists: true") if if_exists
self.class.new(**to_h, name: new_name, to: name)
end
|
#to_sql(_version) ⇒ Object
40
41
42
|
# File 'lib/pg_trunk/operations/materialized_views/rename_materialized_view.rb', line 40
def to_sql(_version)
[*change_schema, *change_name].join("; ")
end
|