mirror of
https://github.com/osmarks/autobotrobot
synced 2025-01-22 21:26:52 +00:00
migration for guild ID change
This commit is contained in:
parent
97a8f9dd19
commit
5019702f62
@ -90,6 +90,13 @@ CREATE TABLE discord_webhooks (
|
||||
channel_id INTEGER PRIMARY KEY,
|
||||
webhook TEXT NOT NULL
|
||||
);
|
||||
""",
|
||||
"""
|
||||
UPDATE user_data SET guild_id = '_global' WHERE rowid IN
|
||||
(SELECT
|
||||
(SELECT rowid FROM user_data d WHERE d.key = user_data.key AND d.user_id = user_data.user_id ORDER BY rowid DESC LIMIT 1)
|
||||
FROM user_data WHERE guild_id IS NULL GROUP BY user_id, key);
|
||||
DELETE FROM user_data WHERE guild_id IS NULL;
|
||||
"""
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user