A platform for community discussion. Free, open, simple.
FIX: Account for empty string setting values when migrating category settings (#22979)
Ted Johansson207d9838090f
diff --git a/db/migrate/20230727015254_change_category_setting_num_auto_bump_daily_default.rb b/db/migrate/20230727015254_change_category_setting_num_auto_bump_daily_default.rbindex 1e1c345d888..7b11b02f8b9 100644--- a/db/migrate/20230727015254_change_category_setting_num_auto_bump_daily_default.rb+++ b/db/migrate/20230727015254_change_category_setting_num_auto_bump_daily_default.rb@@ -10,15 +10,15 @@ class ChangeCategorySettingNumAutoBumpDailyDefault < ActiveRecord::Migration[7.0category_id,MAX(CASE WHEN (name = 'require_topic_approval')- THEN value ELSE NULL END+ THEN NULLIF(value, '') ELSE NULL END)::boolean AS require_topic_approval,MAX(CASE WHEN (name = 'require_reply_approval')- THEN value ELSE NULL END+ THEN NULLIF(value, '') ELSE NULL END)::boolean AS require_reply_approval,MAX(CASE WHEN (name = 'num_auto_bump_daily')- THEN value ELSE NULL END+ THEN NULLIF(value, '') ELSE NULL END)::integer AS num_auto_bump_daily,NOW() AS created_at,NOW() AS updated_at