OXYGENHUB
◆ v0.5.0 oxygenhub / crates / hub / migrations / 0016_hook_format.sql
688 B · SQL · last changed Webhooks: Discord and Slack formats (Discord hooks switched over), a masked URL that wraps, the last delivery in the table, an edit form, and web issue events delivered 1 month ago source blame history raw
1
-- The body a webhook receives (hub spec §12.2): `oxygenhub` (the signed
2
-- envelope), `discord` or `slack`. Discord and Slack webhooks made before
3
-- formats existed switch to their format, since they never accepted the envelope.
4
ALTER TABLE hooks ADD COLUMN format TEXT NOT NULL DEFAULT 'oxygenhub' CHECK (format IN ('oxygenhub', 'discord', 'slack'));
5
UPDATE hooks SET format = 'discord'
6
 WHERE url LIKE 'https://discord.com/api/webhooks/%' OR url LIKE 'https://discordapp.com/api/webhooks/%'
7
    OR url LIKE 'https://canary.discord.com/api/webhooks/%' OR url LIKE 'https://ptb.discord.com/api/webhooks/%';
8
UPDATE hooks SET format = 'slack' WHERE url LIKE 'https://hooks.slack.com/%';