fix(type_de_champ.data): drop former orphan from type_de_champ and champ without coordinates
This commit is contained in:
parent
183506810b
commit
285c7d704a
1 changed files with 14 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: clean_champs_and_type_de_champ_with_no_revision'
|
||||
task clean_champs_and_type_de_champ_with_no_revision: :environment do
|
||||
puts "Running deploy task 'clean_champs_and_type_de_champ_with_no_revision'"
|
||||
|
||||
champs = Champ.where(type_de_champ: TypeDeChamp.where.missing(:revisions))
|
||||
TypeDeChamp.where(id: champs.map(&:type_de_champ_id)).destroy_all
|
||||
|
||||
# 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
|
Loading…
Reference in a new issue