fix(task): temporary bypass ignored en_construction_conservation_extension column on Dossier

This commit is contained in:
François Vantomme 2022-01-28 13:03:57 +01:00
parent 299a98b3cb
commit feabae75c6
No known key found for this signature in database
GPG key ID: 75A448E06F6B75F8

View file

@ -5,6 +5,9 @@ namespace :after_party do
BATCH_SIZE = 20_000
ignored_columns = Dossier.ignored_columns.dup
Dossier.ignored_columns -= ["en_construction_conservation_extension"]
dossiers = Dossier.state_en_construction.where.not(en_construction_conservation_extension: 0.days)
progress = ProgressReport.new((dossiers.count.to_f / BATCH_SIZE).round)
dossiers.in_batches(of: BATCH_SIZE) do |relation|
@ -13,6 +16,8 @@ namespace :after_party do
end
progress.finish
Dossier.ignored_columns = ignored_columns
dossiers_without_conservation_extension = Dossier.where(conservation_extension: nil)
progress = ProgressReport.new((dossiers_without_conservation_extension.count.to_f / BATCH_SIZE).round)
dossiers_without_conservation_extension.in_batches(of: BATCH_SIZE) do |relation|