Class: PGTrunk::Operations::Sequences::CreateSequence
- Inherits:
-
Base
show all
- Defined in:
- lib/pg_trunk/operations/sequences/create_sequence.rb
Instance Method Summary
collapse
Methods inherited from Base
#owned_by
#quote
#dump, #to_a, #to_opts, #to_ruby
#invert!, #irreversible!
#error_messages
#attributes, #initialize
Instance Method Details
#invert ⇒ Object
141
142
143
144
|
# File 'lib/pg_trunk/operations/sequences/create_sequence.rb', line 141
def invert
irreversible!("if_not_exists: true") if if_not_exists
DropSequence.new(**to_h.except(:if_not_exists))
end
|
#to_sql(_server_version) ⇒ Object
137
138
139
|
# File 'lib/pg_trunk/operations/sequences/create_sequence.rb', line 137
def to_sql(_server_version)
[create_sequence, *, register_sequence].join(" ")
end
|