🐛 BotConsole添加迁移sql (#1765)

This commit is contained in:
HibiKier 2024-12-12 16:25:32 +08:00 committed by GitHub
parent bd363a576b
commit a421902bc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -427,3 +427,12 @@ class BotConsole(Model):
"""
bot_data, _ = await cls.get_or_create(bot_id=bot_id)
return cls.format(task_name) in bot_data.block_tasks
@classmethod
async def _run_script(cls):
return [
"ALTER TABLE bot_console RENAME COLUMN block_plugin TO block_plugins;",
"ALTER TABLE bot_console RENAME COLUMN block_task TO block_tasks;",
"ALTER TABLE bot_console ADD available_plugins text default '';",
"ALTER TABLE bot_console ADD available_tasks text default '';",
]