From aa98c36e470eb6b11baacac9a27c72ccf3c3a5c6 Mon Sep 17 00:00:00 2001 From: Alexis Reigel Date: Thu, 31 Aug 2017 18:02:05 +0200 Subject: 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. --- .../20170830084744_destroy_gpg_signatures.rb | 21 +++++++++++++++++++++ ...744_update_gpg_signatures_verification_status.rb | 14 -------------- 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 db/post_migrate/20170830084744_destroy_gpg_signatures.rb delete mode 100644 db/post_migrate/20170830084744_update_gpg_signatures_verification_status.rb (limited to 'db') 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 -- cgit v1.2.1