Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
File.open('./sequences.txt', 'r') do |handle|
handle.each_line do |line|
sequence = line.strip
current = `sudo gitlab-psql -c "SELECT nextval('#{sequence}')" -A -t gitlabhq_production`.strip
if current =~ /^\d+$/
puts `sudo gitlab-psql -c "SELECT setval('#{sequence}', #{current} + 100000);" gitlabhq_production`.strip
else
puts "#{sequence} failed: #{current}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.