diaspora/db/migrate/20201130142541_change_notifications_guid_not_null.rb
2020-11-30 15:42:48 +01:00

17 lines
432 B
Ruby

# 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