DROP INDEX IF EXISTS idx_webhook_dead_letters_template;

DROP TABLE IF EXISTS webhook_dead_letters;

ALTER TABLE webhook_logs
    DROP COLUMN IF EXISTS payload_truncated;

ALTER TABLE webhook_logs
    DROP COLUMN IF EXISTS payload_preview;

ALTER TABLE webhook_logs
    DROP COLUMN IF EXISTS attempt_count;

DROP TABLE IF EXISTS webhook_template_versions;

ALTER TABLE webhook_templates
    DROP CONSTRAINT IF EXISTS webhook_templates_max_retries_chk;

ALTER TABLE webhook_templates
    DROP COLUMN IF EXISTS max_retries;

ALTER TABLE webhook_templates
    DROP COLUMN IF EXISTS signing_secret;

ALTER TABLE webhook_templates
    DROP COLUMN IF EXISTS version;
