Class: PGTrunk::Operations::Statistics::CreateStatistics

Inherits:
Base show all
Defined in:
lib/pg_trunk/operations/statistics/create_statistics.rb

Instance Method Summary collapse

Methods inherited from Base

#column, #expression

Methods included from PGTrunk::Operation::SQLHelpers

#quote

Methods included from PGTrunk::Operation::RubyHelpers

#dump, #to_a, #to_opts, #to_ruby

Methods included from PGTrunk::Operation::Inversion

#invert!, #irreversible!

Methods included from PGTrunk::Operation::Validations

#error_messages

Methods included from PGTrunk::Operation::Attributes

#attributes, #initialize

Instance Method Details

#invertObject



146
147
148
149
# File 'lib/pg_trunk/operations/statistics/create_statistics.rb', line 146

def invert
  irreversible!("if_not_exists: true") if if_not_exists
  DropStatistics.new(**to_h)
end

#to_sql(version) ⇒ Object



140
141
142
143
144
# File 'lib/pg_trunk/operations/statistics/create_statistics.rb', line 140

def to_sql(version)
  check_version!(version)

  [create_statistics, *create_comment, register_object].join(" ")
end