-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10718 from mfo/US/change_delete_orphaned_champs_f…
…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
Showing
3 changed files
with
18 additions
and
80 deletions.
There are no files selected for viewing
33 changes: 0 additions & 33 deletions
33
app/tasks/maintenance/delete_orphaned_champs_with_missing_dossier_task.rb
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
lib/tasks/deployment/20240827085815_delete_orphaned_champs_with_missing_dossier.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
47 changes: 0 additions & 47 deletions
47
spec/tasks/maintenance/delete_orphaned_champs_with_missing_dossier_task_spec.rb
This file was deleted.
Oops, something went wrong.