From feabae75c67510658cf82bb4d41663febd9b9f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Vantomme?= Date: Fri, 28 Jan 2022 13:03:57 +0100 Subject: [PATCH] fix(task): temporary bypass ignored en_construction_conservation_extension column on Dossier --- .../20210429172327_rename_conservation_extension.rake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tasks/deployment/20210429172327_rename_conservation_extension.rake b/lib/tasks/deployment/20210429172327_rename_conservation_extension.rake index 62a9658ae..8d4bf2c05 100644 --- a/lib/tasks/deployment/20210429172327_rename_conservation_extension.rake +++ b/lib/tasks/deployment/20210429172327_rename_conservation_extension.rake @@ -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|