Files
i/server/migrations/0008_mileage_and_insurance.sql
T
wsh5485 65b0bb04f8 feat: import CarLog v2.8 code + dev plan
把 CarLog v2.8 全套源码 + 配置导入到 i 仓库作为 baseline:
- server/src/ (13 个路由 + middleware + services + config)
- server/migrations/ (0001~0018 共 18 个迁移 + mysql)
- server/test/ (12 文件 101 测试)
- client/src/ (20 个 view + components + stores + api + composables)
- client/public/ + client/scripts/
- 全部配置文件 (.editorconfig, .eslintrc.json, .prettierrc.json, vitest.config.js, lighthouserc.json, .pa11yci.json, package.json, carlog-init.sql)
- .husky/pre-commit (git hooks)
- docs/install/ (宝塔部署文档)

不含:
- node_modules/ (本地 npm install)
- .env (敏感, 走 .env.example)
- *.zip / *.log / *.sqlite / .DS_Store

新增文档 docs/DEV-PLAN.md:
- Phase 1: 平台基座 (019 migration + 3 个 platform 路由 + 3 个 view)
- Phase 2: CarLog 子系统化 (后端 routes/ → subsystems/carlog/ + 前端 views/ → views/subsystems/carlog/ + 元数据驱动菜单)
- Phase 3: 验证 (测试 + E2E + DB 完整性)
- 交付清单 + commit 模板 + 给 Mavis review 的材料

后续 Trae 实施, 提交后我 code review + 跑测试。
2026-06-20 22:30:19 +08:00

28 lines
1.5 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 0008_mileage_and_insurance.sql
-- 1. 混动车:保养记录加 EV 里程和 HEV 里程
ALTER TABLE maintenance_records ADD COLUMN ev_km INTEGER;
ALTER TABLE maintenance_records ADD COLUMN hev_km INTEGER;
-- 2. 保险记录(含附件)
CREATE TABLE IF NOT EXISTS insurance_records (
id INTEGER PRIMARY KEY AUTOINCREMENT,
vehicle_id INTEGER NOT NULL,
insurance_type TEXT NOT NULL, -- 交强险 / 商业险 / 车损险 / 三责险 / 座位险 / 不计免赔 / 玻璃险 / 划痕险 / 自燃险 / 涉水险
company TEXT, -- 人保 / 平安 / 太保 / 中华 / ...
policy_no TEXT, -- 保单号
start_date TEXT NOT NULL, -- 生效日
end_date TEXT NOT NULL, -- 到期日
premium REAL, -- 保费
coverage_amount REAL, -- 保额(可选)
notes TEXT,
attachment_path TEXT, -- 保单图片/PDF 相对路径(uploads/insurance/xxx.pdf
attachment_name TEXT, -- 原文件名
attachment_mime TEXT, -- mime type
attachment_size INTEGER, -- 字节
created_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
FOREIGN KEY (vehicle_id) REFERENCES vehicles(id) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_insurance_vehicle ON insurance_records(vehicle_id);
CREATE INDEX IF NOT EXISTS idx_insurance_end_date ON insurance_records(end_date);