Merge pull request #6912 from adullact/fix/6870-migration-export-key

Correction de la migration 20210402163003_exports_key_not_null
This commit is contained in:
Pierre de La Morinerie 2022-03-15 09:01:16 +01:00 committed by GitHub
commit 8b1af41273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,13 @@
namespace :after_party do
desc 'Deployment task: null_exports_key_to_uuid'
task null_exports_key_to_uuid: :environment do
puts "Running deploy task 'null_exports_key_to_uuid'"
Export.where(key: nil).update_all(key: SecureRandom.uuid)
# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
end
end