mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-09 15:26:03 +00:00
Compare commits
4 Commits
v4.3.0.bet
...
v4.3.0.bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3a147bbdd | ||
|
|
8eb1b8759b | ||
|
|
0155d3b0b9 | ||
|
|
e47a5b4e0d |
@@ -8,17 +8,24 @@ class DBMigratePluginInstallSource(migration.DBMigration):
|
|||||||
|
|
||||||
async def upgrade(self):
|
async def upgrade(self):
|
||||||
"""升级"""
|
"""升级"""
|
||||||
# add new column install_source, use default value 'github', via alter table
|
# 查询表结构获取所有列名(异步执行 SQL)
|
||||||
await self.ap.persistence_mgr.execute_async(
|
result = await self.ap.persistence_mgr.execute_async(sqlalchemy.text('PRAGMA table_info(plugin_settings);'))
|
||||||
sqlalchemy.text(
|
# fetchall() 是同步方法,无需 await
|
||||||
"ALTER TABLE plugin_settings ADD COLUMN install_source VARCHAR(255) NOT NULL DEFAULT 'github'"
|
columns = [row[1] for row in result.fetchall()]
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
# add new column install_info, use default value {}, via alter table
|
# 检查并添加 install_source 列
|
||||||
await self.ap.persistence_mgr.execute_async(
|
if 'install_source' not in columns:
|
||||||
sqlalchemy.text("ALTER TABLE plugin_settings ADD COLUMN install_info JSON NOT NULL DEFAULT '{}'")
|
await self.ap.persistence_mgr.execute_async(
|
||||||
)
|
sqlalchemy.text(
|
||||||
|
"ALTER TABLE plugin_settings ADD COLUMN install_source VARCHAR(255) NOT NULL DEFAULT 'github'"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# 检查并添加 install_info 列
|
||||||
|
if 'install_info' not in columns:
|
||||||
|
await self.ap.persistence_mgr.execute_async(
|
||||||
|
sqlalchemy.text("ALTER TABLE plugin_settings ADD COLUMN install_info JSON NOT NULL DEFAULT '{}'")
|
||||||
|
)
|
||||||
|
|
||||||
async def downgrade(self):
|
async def downgrade(self):
|
||||||
"""降级"""
|
"""降级"""
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
semantic_version = 'v4.3.0.beta1'
|
semantic_version = 'v4.3.0.beta3'
|
||||||
|
|
||||||
required_database_version = 5
|
required_database_version = 5
|
||||||
"""标记本版本所需要的数据库结构版本,用于判断数据库迁移"""
|
"""标记本版本所需要的数据库结构版本,用于判断数据库迁移"""
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "langbot"
|
name = "langbot"
|
||||||
version = "4.3.0.beta1"
|
version = "4.3.0.beta3"
|
||||||
description = "高稳定、支持扩展、多模态 - 大模型原生即时通信机器人平台"
|
description = "高稳定、支持扩展、多模态 - 大模型原生即时通信机器人平台"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10.1"
|
requires-python = ">=3.10.1"
|
||||||
@@ -50,7 +50,7 @@ dependencies = [
|
|||||||
"pre-commit>=4.2.0",
|
"pre-commit>=4.2.0",
|
||||||
"uv>=0.7.11",
|
"uv>=0.7.11",
|
||||||
"mypy>=1.16.0",
|
"mypy>=1.16.0",
|
||||||
"langbot-plugin==0.1.1b1",
|
"langbot-plugin==0.1.1b2",
|
||||||
]
|
]
|
||||||
keywords = [
|
keywords = [
|
||||||
"bot",
|
"bot",
|
||||||
|
|||||||
Reference in New Issue
Block a user