Files
leadchat/db/migrate/20230801180936_update_default_status_in_hooks.rb
Pranav Raj S 3a547de909 fix: Update the default status of the hooks to enabled (#7652)
In the recent Slack integration update, we made changes to how hooks are handled. Now, hooks require an additional check to be enabled. By default, new hooks are created in a disabled state, which might lead to issues with the hooks not being executed as expected.

This migration updates the status attribute of hooks to have 'enabled' as the default value, ensuring that new hooks are enabled by default and can function properly.
2023-08-01 12:14:47 -07:00

18 lines
343 B
Ruby

class UpdateDefaultStatusInHooks < ActiveRecord::Migration[7.0]
def up
change_column_default :integrations_hooks, :status, 1
update_default_status
end
def down
change_column_default :integrations_hooks, :status, 0
end
private
def update_default_status
Integrations::Hook.all.update(status: 'enabled')
end
end