fix notifications migrations

notifications are unsharded, so the data only applies to the default
shard

Change-Id: I742e39c0ae131bc8ce37358285ae35a71e9d928f
Reviewed-on: https://gerrit.instructure.com/23610
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2013-08-22 13:41:01 -06:00 committed by Brian Palmer
parent 718e629dd7
commit 3e39d030f1
1 changed files with 2 additions and 0 deletions

View File

@ -2,11 +2,13 @@ class MoveMigrationNotificationsToSeparateCategory < ActiveRecord::Migration
tag :postdeploy
def self.up
return unless Shard.current == Shard.default
Notification.where(:name => ['Migration Export Ready', 'Migration Import Finished', 'Migration Import Failed']).
update_all(:category => 'Migration')
end
def self.down
return unless Shard.current == Shard.default
Notification.where(:name => ['Migration Export Ready', 'Migration Import Finished', 'Migration Import Failed']).
update_all(:category => 'Other')
end