-- Expand gateway_webhook.route_key allowed values for management / schema DDL webhooks.
-- Safe to re-run: drops and recreates the CHECK constraint.

ALTER TABLE gateway_webhook DROP CONSTRAINT IF EXISTS gateway_webhook_route_key_check;

ALTER TABLE gateway_webhook ADD CONSTRAINT gateway_webhook_route_key_check CHECK (route_key IN (
    'gateway_data', 'gateway_fetch', 'gateway_update', 'gateway_query',
    'gateway_insert', 'gateway_delete',
    'rest_get', 'rest_post', 'rest_patch', 'rest_delete',
    'schema_table_created', 'schema_table_dropped',
    'schema_column_added', 'schema_column_dropped', 'schema_column_renamed', 'schema_column_altered',
    'schema_index_created', 'schema_index_dropped', 'schema_extension_installed'
));
