Skip to content

A platform for community discussion. Free, open, simple.

DEV: Rebake posts w/ quotes to update category badge style (#24469)

Blake Ericksonef7e5ed9b463
diff --git a/db/post_migrate/20231120190818_trigger_post_rebake_category_style_quotes.rb b/db/post_migrate/20231120190818_trigger_post_rebake_category_style_quotes.rb
new file mode 100644
index 00000000000..7adb3ed7e9f
--- /dev/null
+++ b/db/post_migrate/20231120190818_trigger_post_rebake_category_style_quotes.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class TriggerPostRebakeCategoryStyleQuotes < ActiveRecord::Migration[7.0]
+ def up
+ DB.exec(<<~SQL)
+ UPDATE posts
+ SET baked_version = NULL
+ WHERE cooked LIKE '%blockquote%'
+ SQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end