diff --git a/lib/tasks/deployment/20231109145911_backfill_procedure_expires_when_termine_enabled_without_dossiers.rake b/lib/tasks/deployment/20231109145911_backfill_procedure_expires_when_termine_enabled_without_dossiers.rake new file mode 100644 index 000000000..14cb78e8e --- /dev/null +++ b/lib/tasks/deployment/20231109145911_backfill_procedure_expires_when_termine_enabled_without_dossiers.rake @@ -0,0 +1,13 @@ +namespace :after_party do + desc 'Deployment task: backfill_procedure_expires_when_termine_enabled_without_dossiers' + task backfill_procedure_expires_when_termine_enabled_without_dossiers: :environment do + puts "Running deploy task 'backfill_procedure_expires_when_termine_enabled_without_dossiers'" + + Procedure.where.missing(:dossiers) + .where(procedure_expires_when_termine_enabled: false) + .update_all(procedure_expires_when_termine_enabled: true) + + AfterParty::TaskRecord + .create version: AfterParty::TaskRecorder.new(__FILE__).timestamp + end +end