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.
This commit is contained in:
17
db/migrate/20230801180936_update_default_status_in_hooks.rb
Normal file
17
db/migrate/20230801180936_update_default_status_in_hooks.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
Reference in New Issue
Block a user