FIX: Don't allow NULL values for notification_level in category_users (#15407)

This commit is contained in:
Osama Sayegh
2021-12-29 01:19:39 +03:00
committed by GitHub
parent 91a816e788
commit 8e6988163f
5 changed files with 18 additions and 16 deletions

View File

@@ -0,0 +1,10 @@
# frozen_string_literal: true
class NotNullNotificationLevelInCategoryUsers < ActiveRecord::Migration[6.1]
def change
up_only do
execute("DELETE FROM category_users WHERE notification_level IS NULL")
end
change_column_null :category_users, :notification_level, false
end
end