Commit aa98c36e authored by Alexis Reigel's avatar Alexis Reigel

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.
parent 7f45dd92
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
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment