From e3318e8266d142d98e170b83c4777d44a00dbbf2 Mon Sep 17 00:00:00 2001 From: iven Date: Wed, 20 May 2026 19:36:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(db):=20=E8=BF=81=E7=A7=BB=20157=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20=E2=80=94=20points=5Frule=20=E5=88=97=E5=90=8D=20po?= =?UTF-8?q?ints=20=E2=86=92=20points=5Fvalue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 迁移 SQL 中 INSERT 使用了错误的列名 `points`, 实际表结构为 `points_value`。修复后迁移成功执行: - follow_up_task 新增 source_type/source_id 列 - points_rule 新增 3 条积分规则种子数据 --- .../m20260520_000157_follow_up_source_and_points_rules.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/erp-server/migration/src/m20260520_000157_follow_up_source_and_points_rules.rs b/crates/erp-server/migration/src/m20260520_000157_follow_up_source_and_points_rules.rs index e4b0097..52bf4c5 100644 --- a/crates/erp-server/migration/src/m20260520_000157_follow_up_source_and_points_rules.rs +++ b/crates/erp-server/migration/src/m20260520_000157_follow_up_source_and_points_rules.rs @@ -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,