| 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 | 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/%'; |