diff --git a/lib/tasks/deployment/20181123181252_add_stable_id_to_types_de_champ.rake b/lib/tasks/deployment/20181123181252_add_stable_id_to_types_de_champ.rake new file mode 100644 index 000000000..dbb3283dd --- /dev/null +++ b/lib/tasks/deployment/20181123181252_add_stable_id_to_types_de_champ.rake @@ -0,0 +1,15 @@ +namespace :after_party do + desc 'Deployment task: add_stable_id_to_types_de_champ' + task add_stable_id_to_types_de_champ: :environment do + types_de_champ = TypeDeChamp.where(stable_id: nil) + bar = RakeProgressbar.new(types_de_champ.count) + + types_de_champ.find_each do |type_de_champ| + type_de_champ.update_column(:stable_id, type_de_champ.id) + bar.inc + end + bar.finished + + AfterParty::TaskRecord.create version: '20181123181252' + end +end