mirror of https://gitlab.com/litecord/litecord.git
add 15_drop_nullable_webhook_avatar.sql
- webhooks: quickfix to webhook_check
This commit is contained in:
parent
712f1d9ff2
commit
e8c158da81
|
|
@ -73,7 +73,7 @@ async def get_webhook(webhook_id: int, *,
|
||||||
async def _webhook_check(channel_id):
|
async def _webhook_check(channel_id):
|
||||||
user_id = await token_check()
|
user_id = await token_check()
|
||||||
|
|
||||||
await channel_check(user_id, channel_id, ChannelType.GUILD_TEXT)
|
await channel_check(user_id, channel_id, only=ChannelType.GUILD_TEXT)
|
||||||
await channel_perm_check(user_id, channel_id, 'manage_webhooks')
|
await channel_perm_check(user_id, channel_id, 'manage_webhooks')
|
||||||
|
|
||||||
return user_id
|
return user_id
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE webhooks ALTER COLUMN avatar DROP NOT NULL;
|
||||||
|
ALTER TABLE webhooks ALTER COLUMN avatar SET DEFAULT NULL;
|
||||||
|
|
@ -542,7 +542,7 @@ CREATE TABLE IF NOT EXISTS webhooks (
|
||||||
creator_id bigint REFERENCES users (id),
|
creator_id bigint REFERENCES users (id),
|
||||||
|
|
||||||
name text NOT NULL,
|
name text NOT NULL,
|
||||||
avatar text NOT NULL,
|
avatar text DEFAULT NULL,
|
||||||
|
|
||||||
-- Yes, we store the webhook's token
|
-- Yes, we store the webhook's token
|
||||||
-- since they aren't users and there's no /api/login for them.
|
-- since they aren't users and there's no /api/login for them.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue