summaryrefslogtreecommitdiff
path: root/db
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
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')
-rw-r--r--db/post_migrate/20170830084744_destroy_gpg_signatures.rb21
-rw-r--r--db/post_migrate/20170830084744_update_gpg_signatures_verification_status.rb14
2 files changed, 21 insertions, 14 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
diff --git a/db/post_migrate/20170830084744_update_gpg_signatures_verification_status.rb b/db/post_migrate/20170830084744_update_gpg_signatures_verification_status.rb
deleted file mode 100644
index 16337b83992..00000000000
--- a/db/post_migrate/20170830084744_update_gpg_signatures_verification_status.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class UpdateGpgSignaturesVerificationStatus < ActiveRecord::Migration
- DOWNTIME = false
-
- def up
- GpgSignature.where(verification_status: nil).find_each do |gpg_signature|
- gpg_signature.gpg_commit.update_signature!(gpg_signature)
- end
- end
-
- def down
- # we can't revert setting the verification_status, but actually we don't
- # need to really, as setting this is not a harmful change.
- end
-end