OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove more notification migrations
Oliver Günther1e736cbdf01d
diff --git a/db/migrate/20210701073944_add_digest_setting.rb b/db/migrate/20210701073944_add_digest_setting.rbindex 910066157ef..cfcb97c0731 100644--- a/db/migrate/20210701073944_add_digest_setting.rb+++ b/db/migrate/20210701073944_add_digest_setting.rb@@ -1,34 +1,12 @@class AddDigestSetting < ActiveRecord::Migration[6.1]def up- insert_default_digest_channel+ # No-openddef downremove_digest_channelsend- def insert_default_digest_channel- execute <<~SQL- INSERT INTO- notification_settings- (user_id,- channel,- involved,- mentioned,- watched)- SELECT- id,- 2,- true,- true,- true- FROM- users- WHERE- type = 'User'- SQL- end-# Removes all digest channels. Includes non default channels as those might# also have been added not by the migration but in the cause of the functionality# the migration was added for.diff --git a/db/migrate/20210914065555_cleanup_notifications.rb b/db/migrate/20210914065555_cleanup_notifications.rbindex e1a15b44416..9de1b20ec84 100644--- a/db/migrate/20210914065555_cleanup_notifications.rb+++ b/db/migrate/20210914065555_cleanup_notifications.rb@@ -55,25 +55,6 @@ class CleanupNotifications < ActiveRecord::Migration[6.1]where: "project_id IS NOT NULL",name: 'index_notification_settings_unique_project'end-- # Set all channels to ian- execute <<~SQL.squish- UPDATE notification_settings SET channel = 0;- SQL-- # Restore notification settings- execute <<~SQL.squish- INSERT INTO notification_settings- (project_id, user_id, channel, watched, involved, mentioned,- work_package_commented, work_package_created, work_package_processed, work_package_prioritized, work_package_scheduled)- SELECT project_id, user_id, channel + 1, watched, involved, mentioned,- work_package_commented, work_package_created, work_package_processed, work_package_prioritized, work_package_scheduled- FROM notification_settings- UNION- SELECT project_id, user_id, channel + 2, watched, involved, mentioned,- work_package_commented, work_package_created, work_package_processed, work_package_prioritized, work_package_scheduled- FROM notification_settings;- SQLend# rubocop:enable Metrics/AbcSizeend