修复initAssociations() 函数被调用了两次的问题

This commit is contained in:
zhang1106
2025-12-26 14:20:14 +08:00
parent f2327ea3f1
commit 54ff2c8108
2 changed files with 586 additions and 4 deletions
-3
View File
@@ -163,9 +163,6 @@ const initAssociations = () => {
TicketOperationRecord.belongsTo(Ticket, { foreignKey: 'ticketId' });
};
// 立即初始化关联(在模型导出前)
initAssociations();
const initializeModels = async () => {
try {
await sequelize.sync({ alter: true });