Welcome to mirror list, hosted at ThFree Co, Russian Federation.

drop_all_postgres_sequences.rake « db « gitlab « tasks « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e9cf0a9b5e862cc16d1b886ecac14ff424d8807c (plain)
1
2
3
4
5
6
7
8
9
10
namespace :gitlab do
  namespace :db do
    task drop_all_postgres_sequences: :environment do
      connection = ActiveRecord::Base.connection
      connection.execute("SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';").each do |sequence|
        connection.execute("DROP SEQUENCE #{sequence['relname']}")
      end
    end
  end
end