Class: PGTrunk::Operations::Statistics::DropStatistics
- Inherits:
-
Base
show all
- Defined in:
- lib/pg_trunk/operations/statistics/drop_statistics.rb
Instance Method Summary
collapse
Methods inherited from Base
#column, #expression
#quote
#dump, #to_a, #to_opts, #to_ruby
#invert!, #irreversible!
#error_messages
#attributes, #initialize
Instance Method Details
#invert ⇒ Object
80
81
82
83
84
|
# File 'lib/pg_trunk/operations/statistics/drop_statistics.rb', line 80
def invert
irreversible!("if_exists: true") if if_exists
irreversible!("force: :cascade") if force == :cascade
CreateStatistics.new(**to_h.except(:force))
end
|
#to_sql(_version) ⇒ Object
72
73
74
75
76
77
78
|
# File 'lib/pg_trunk/operations/statistics/drop_statistics.rb', line 72
def to_sql(_version)
sql = "DROP STATISTICS"
sql << " IF EXISTS" if if_exists
sql << " #{name.to_sql}"
sql << " CASCADE" if force == :cascade
sql << ";"
end
|