Revert "FIX: supports groups field in post_created_edited (#28773)" (#28781)

This reverts commit eb3a1c72179c179af358daf41b167e337cc7b454.
This commit is contained in:
Joffrey JAFFEUX
2024-09-06 16:10:53 +02:00
committed by GitHub
parent eb3a1c7217
commit 5f5680dbaf
9 changed files with 22 additions and 201 deletions

View File

@ -1,22 +0,0 @@
# frozen_string_literal: true
class UpdateFieldsForPostCreatedEditedTrigger < ActiveRecord::Migration[7.1]
def up
execute <<-SQL
UPDATE discourse_automation_fields
SET
component = 'groups',
name = 'restricted_groups',
metadata = jsonb_set(metadata, '{value}', to_jsonb(ARRAY[(metadata->>'value')::int]))
FROM discourse_automation_automations
WHERE discourse_automation_fields.automation_id = discourse_automation_automations.id
AND discourse_automation_automations.trigger = 'post_created_edited'
AND discourse_automation_fields.name = 'restricted_group'
AND discourse_automation_fields.component = 'group';
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end