From 5170c0ab6f90cf480aa6dd5c0f2415fc576b7d7e Mon Sep 17 00:00:00 2001 From: gituib Date: Wed, 6 May 2026 03:08:12 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8B=89=E5=8F=96=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: traeagent --- backend/server.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/backend/server.js b/backend/server.js index 36d5164..b86ecd4 100644 --- a/backend/server.js +++ b/backend/server.js @@ -96,18 +96,10 @@ async function syncBusinessModels() { const DeviceBusiness = require('./models/DeviceBusiness'); const Warehouse = require('./models/Warehouse'); - // 仅在开发环境使用 sync({ alter: true }),生产环境应使用 migrations - if (process.env.NODE_ENV !== 'production') { - await Business.sync({ alter: true }); - await DeviceBusiness.sync({ alter: true }); - await Warehouse.sync({ alter: true }); - logger.info('业务/设备关联/库房模型同步完成(alter mode)'); - } else { - await Business.sync(); - await DeviceBusiness.sync(); - await Warehouse.sync(); - logger.info('业务/设备关联/库房模型同步完成(safe mode)'); - } + await Business.sync(); + await DeviceBusiness.sync(); + await Warehouse.sync(); + logger.info('业务/设备关联/库房模型同步完成'); } async function initDefaultSystemSettings() {