Skip to content

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

DEV: Clean up old polls data from custom fields

Loïc Guitautc08a52e5025a
diff --git a/plugins/poll/db/post_migrate/20230612134421_remove_old_polls_data_from_custom_fields.rb b/plugins/poll/db/post_migrate/20230612134421_remove_old_polls_data_from_custom_fields.rb
new file mode 100644
index 00000000000..3df78a4bd67
--- /dev/null
+++ b/plugins/poll/db/post_migrate/20230612134421_remove_old_polls_data_from_custom_fields.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class RemoveOldPollsDataFromCustomFields < ActiveRecord::Migration[7.0]
+ def up
+ execute <<~SQL
+ DELETE FROM post_custom_fields
+ WHERE name LIKE 'polls%'
+ SQL
+ end
+
+ def down
+ end
+end