Преглед изворни кода

fix(backend): add products.min_quantity migration to runMigrations()

The ensureColumn call was written as dead comments (lines 6242-6273) but
never actually executed inside runMigrations(), so the production DB
was missing the column. This adds the call at the end of runMigrations()
so it runs on next startup.
Xiaogang Liao пре 3 месеци
родитељ
комит
4c194577fc

+ 3 - 0
cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java

@@ -6414,6 +6414,9 @@ private void runMigration98() {
 	} catch (Exception e) {
 		// 列已存在,忽略错误
 	}
+
+	// 迁移: products表添加min_quantity列(商品最小购买数限制)
+	ensureColumn("products", "min_quantity", "INT DEFAULT 1 COMMENT '最小购买数量限制'");
 }
 
 private void runMigration99() {