fix(db): 迁移 157 修复 — points_rule 列名 points → points_value

迁移 SQL 中 INSERT 使用了错误的列名 `points`,
实际表结构为 `points_value`。修复后迁移成功执行:
- follow_up_task 新增 source_type/source_id 列
- points_rule 新增 3 条积分规则种子数据
This commit is contained in:
iven
2026-05-20 19:36:36 +08:00
parent 80ee83861c
commit e3318e8266

View File

@@ -19,7 +19,7 @@ impl MigrationTrait for Migration {
// 2. 新增积分规则种子:健康数据上报
let insert_sql = r#"
INSERT INTO points_rule (id, tenant_id, name, event_type, points, daily_cap, is_active, created_at, updated_at, version)
INSERT INTO points_rule (id, tenant_id, name, event_type, points_value, daily_cap, is_active, created_at, updated_at, version)
SELECT
gen_random_uuid(),
t.id,
@@ -37,7 +37,7 @@ impl MigrationTrait for Migration {
WHERE pr.event_type = 'health_data_report' AND pr.tenant_id = t.id
);
INSERT INTO points_rule (id, tenant_id, name, event_type, points, daily_cap, is_active, created_at, updated_at, version)
INSERT INTO points_rule (id, tenant_id, name, event_type, points_value, daily_cap, is_active, created_at, updated_at, version)
SELECT
gen_random_uuid(),
t.id,
@@ -55,7 +55,7 @@ impl MigrationTrait for Migration {
WHERE pr.event_type = 'lab_report_upload' AND pr.tenant_id = t.id
);
INSERT INTO points_rule (id, tenant_id, name, event_type, points, daily_cap, is_active, created_at, updated_at, version)
INSERT INTO points_rule (id, tenant_id, name, event_type, points_value, daily_cap, is_active, created_at, updated_at, version)
SELECT
gen_random_uuid(),
t.id,