diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-07 15:34:06 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-07-07 15:34:06 +0200 |
commit | 90ab5a59bb28053c9da768679b8036caa7885e95 (patch) | |
tree | 165b67480476630a8d799a740b88bb2850c7d795 /lib/tasks | |
parent | 17446ff0c98e870f0500279983432e5115e060a4 (diff) | |
download | gitlab-ce-90ab5a59bb28053c9da768679b8036caa7885e95.tar.gz |
Use native Postgres database cleaning during backup restore
We were using hacks to drop tables etc during a Postgres backup
restore. With this change, we let pg_dump insert the DROP TABLE
statements it needs at the start of the SQL dump.
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/db/drop_all_postgres_sequences.rake | 10 | ||||
-rw-r--r-- | lib/tasks/gitlab/db/drop_all_tables.rake | 10 |
2 files changed, 0 insertions, 20 deletions
diff --git a/lib/tasks/gitlab/db/drop_all_postgres_sequences.rake b/lib/tasks/gitlab/db/drop_all_postgres_sequences.rake deleted file mode 100644 index e9cf0a9b5e8..00000000000 --- a/lib/tasks/gitlab/db/drop_all_postgres_sequences.rake +++ /dev/null @@ -1,10 +0,0 @@ -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 diff --git a/lib/tasks/gitlab/db/drop_all_tables.rake b/lib/tasks/gitlab/db/drop_all_tables.rake deleted file mode 100644 index a66030ab93a..00000000000 --- a/lib/tasks/gitlab/db/drop_all_tables.rake +++ /dev/null @@ -1,10 +0,0 @@ -namespace :gitlab do - namespace :db do - task drop_all_tables: :environment do - connection = ActiveRecord::Base.connection - connection.tables.each do |table| - connection.drop_table(table) - end - end - end -end |