mirror of https://gitlab.com/litecord/litecord.git
16_messages_webhooks.sql: fix comments
- storage: add explanation for wb_info
This commit is contained in:
parent
02c6741d74
commit
dab830066b
|
|
@ -803,6 +803,10 @@ class Storage:
|
|||
# if author_id is None, we fetch webhook info
|
||||
# from the message_webhook_info table.
|
||||
if author_id is None:
|
||||
# webhook information in a message when made by a webhook
|
||||
# is copied from the webhook table, or inserted by the webhook
|
||||
# itself. this causes a complete disconnect from the messages
|
||||
# table into the webhooks table.
|
||||
wb_info = await self.db.fetchrow("""
|
||||
SELECT webhook_id, name, avatar
|
||||
FROM message_webhook_info
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
-- this is a tricky one. blame discord
|
||||
|
||||
-- first, remove all messages made by webhooks
|
||||
-- first, remove all messages made by webhooks (safety check)
|
||||
DELETE FROM messages WHERE author_id is null;
|
||||
|
||||
-- delete the row, removing the fkey. no connection anymore.
|
||||
-- delete the column, removing the fkey. no connection anymore.
|
||||
ALTER TABLE messages DROP COLUMN webhook_id;
|
||||
|
||||
-- add a message_webhook_info table. more on that in Storage._inject_author
|
||||
Loading…
Reference in New Issue