Skip to content

Commit

Permalink
Merge pull request #10718 from mfo/US/change_delete_orphaned_champs_f…
Browse files Browse the repository at this point in the history
…rom_maintenance_task_to_after_party

ETQ Tech, je souhaite pouvoir lancer une tache de migration avec un PG_STATEMENT_TIMEOUT personnalisable
  • Loading branch information
mfo authored Aug 27, 2024
2 parents 0771d20 + bab8fc2 commit a784b01
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 80 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

namespace :after_party do
desc 'Deployment task: delete_orphaned_champs_with_missing_dossier'
task delete_orphaned_champs_with_missing_dossier: :environment do
puts "Running deploy task 'delete_orphaned_champs_with_missing_dossier'"

Champ.select(:id, :type).where.missing(:dossier).each do |champ|
champ.champs.destroy_all if champ.type == 'Champs::RepetitionChamp'
champ.destroy
end

# 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

This file was deleted.

0 comments on commit a784b01

Please sign in to comment.