summaryrefslogtreecommitdiff
path: root/db/post_migrate/20170830084744_destroy_gpg_signatures.rb
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-08-31 18:02:05 +0200
committerAlexis Reigel <mail@koffeinfrei.org>2017-09-05 12:18:33 +0200
commitaa98c36e470eb6b11baacac9a27c72ccf3c3a5c6 (patch)
tree3d0c3935ba238538883a7e7f64409856de615291 /db/post_migrate/20170830084744_destroy_gpg_signatures.rb
parent7f45dd92eaf70ec624d639f9d0354b6f3c512dc6 (diff)
downloadgitlab-ce-aa98c36e470eb6b11baacac9a27c72ccf3c3a5c6.tar.gz
destroy signatures instead of updating them
This is faster for the deployment process, as the destroyed signatures will be re-generated on demand again, instead of updating them all on deploy.
Diffstat (limited to 'db/post_migrate/20170830084744_destroy_gpg_signatures.rb')
-rw-r--r--db/post_migrate/20170830084744_destroy_gpg_signatures.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/post_migrate/20170830084744_destroy_gpg_signatures.rb b/db/post_migrate/20170830084744_destroy_gpg_signatures.rb
new file mode 100644
index 00000000000..de2e7e79e86
--- /dev/null
+++ b/db/post_migrate/20170830084744_destroy_gpg_signatures.rb
@@ -0,0 +1,21 @@
+class DestroyGpgSignatures < ActiveRecord::Migration
+ DOWNTIME = false
+
+ include Gitlab::Database::MigrationHelpers
+ disable_ddl_transaction!
+
+ class GpgSignature < ActiveRecord::Base
+ self.table_name = 'gpg_signatures'
+
+ include EachBatch
+ end
+
+ def up
+ GpgSignature.each_batch do |relation|
+ relation.delete_all
+ end
+ end
+
+ def down
+ end
+end