Merge pull request #8187 from jhass/notifications_not_null

Enforce GUID being present for notifications
This commit is contained in:
Dennis Schubert 2021-02-13 04:36:57 +01:00
commit 6c49ba1d2e
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
class ChangeNotificationsGuidNotNull < ActiveRecord::Migration[5.2]
def up
Notification.where(guid: nil).find_in_batches do |batch|
batch.each do |notification|
notification.save!(validate: false, touch: false)
end
end
change_column :notifications, :guid, :string, null: false
end
def down
change_column :notifications, :guid, :string, null: true
end
end