From 8395363811ac3f30fa336fac1d88f1b0bfaf718b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 8 Apr 2020 18:06:42 +0200 Subject: [PATCH] Maintenance task to migrate notifications for Fab-manager v1 --- CHANGELOG.md | 1 + lib/tasks/fablab/maintenance.rake | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3a468800..6229981aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Updated documentation - Changed In-Context pseudo-language to Zulu instead of Acholi - Allow removing contacts from the about page +- Maintenance task to migrate notifications for Fab-manager v1 - Fix a bug: installation without nginx does not remove the service from the docker-compose file - Fix a bug: default twitter feed is invalid - Fix a bug: default nginx configuration does not allows secure cookies diff --git a/lib/tasks/fablab/maintenance.rake b/lib/tasks/fablab/maintenance.rake index e9b15205b..b749fc0b0 100644 --- a/lib/tasks/fablab/maintenance.rake +++ b/lib/tasks/fablab/maintenance.rake @@ -68,5 +68,13 @@ namespace :fablab do task rebuild_stylesheet: :environment do Stylesheet.build_sheet! end + + desc 'migration notifications from Fab-manager v1' + task migrate_v1_notifications: :environment do + Notification.where(notification_type_id: 4).each do |n| + n.notification_type_id = 11 + n.save! + end + end end end