提交 aa98c36e 编写于 作者: A 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.
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册