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.
18 lines
343 B
Ruby
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
|