Compare commits
1 Commits
2d6c9f03dd
...
6724af7951
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6724af7951 |
@@ -175,6 +175,22 @@ async def _create_tables(pool: aiomysql.Pool):
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
# V2.0.3 迁移:为旧表补充波动测试参数字段
|
||||||
|
for col, col_def in [
|
||||||
|
("FarTol", "INT DEFAULT 0 COMMENT '最远容差 cm'"),
|
||||||
|
("NearTol", "INT DEFAULT 0 COMMENT '最近容差 cm'"),
|
||||||
|
("StepTol", "INT DEFAULT 0 COMMENT '步进容差 cm'"),
|
||||||
|
("BackForth", "INT DEFAULT 0 COMMENT '来回次数'"),
|
||||||
|
("NearStay", "INT DEFAULT 0 COMMENT '最近停留时间 ms'"),
|
||||||
|
("FarStay", "INT DEFAULT 0 COMMENT '最远停留时间 ms'"),
|
||||||
|
]:
|
||||||
|
try:
|
||||||
|
await cur.execute(
|
||||||
|
f"ALTER TABLE `tb_fixture_param` ADD COLUMN `{col}` {col_def}"
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass # 列已存在,忽略
|
||||||
|
|
||||||
# 7. 车检器测试基准参数表
|
# 7. 车检器测试基准参数表
|
||||||
await cur.execute("""
|
await cur.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS `tb_vechicle_base_test` (
|
CREATE TABLE IF NOT EXISTS `tb_vechicle_base_test` (
|
||||||
|
|||||||
Reference in New Issue
Block a user