fix(migration): backfill procedure nil duree_conservation_etendue_par_ds
This commit is contained in:
parent
ecd24378d6
commit
f0ff364ed6
1 changed files with 8 additions and 2 deletions
|
@ -1,10 +1,16 @@
|
|||
class ReBackfillProcedureMaxDureeConservationDossiers < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
Procedure.where(duree_conservation_etendue_par_ds: true).in_batches do |batch|
|
||||
Procedure.with_discarded.where(duree_conservation_etendue_par_ds: true).in_batches do |batch|
|
||||
batch.update_all(max_duree_conservation_dossiers_dans_ds: Procedure::OLD_MAX_DUREE_CONSERVATION)
|
||||
end
|
||||
Procedure.where(duree_conservation_etendue_par_ds: false).in_batches do |batch|
|
||||
Procedure.with_discarded.where(duree_conservation_etendue_par_ds: false).in_batches do |batch|
|
||||
batch.update_all(max_duree_conservation_dossiers_dans_ds: Procedure::NEW_MAX_DUREE_CONSERVATION)
|
||||
end
|
||||
Procedure.with_discarded.where(duree_conservation_etendue_par_ds: nil).in_batches do |batch|
|
||||
batch.update_all(
|
||||
duree_conservation_etendue_par_ds: false,
|
||||
max_duree_conservation_dossiers_dans_ds: Procedure::NEW_MAX_DUREE_CONSERVATION
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue