更新技术实施方案和PRD文档版本历史

This commit is contained in:
2025-09-12 13:10:44 +08:00
parent 320f41f25d
commit bbc7abd69c
13 changed files with 5565 additions and 406 deletions

View File

@@ -22,6 +22,9 @@ const sequelize = new Sequelize(
}
);
// 导入模型定义
const defineOrder = require('./order.js');
// 测试数据库连接
const testConnection = async () => {
try {
@@ -118,15 +121,23 @@ const models = {
}, {
tableName: 'api_users',
timestamps: true
})
}),
// 订单模型
Order: defineOrder(sequelize)
};
// 同步数据库模型
const syncModels = async () => {
try {
// 同步API用户表如果不存在则创建
// 同步API用户表如果不存在则创建
await models.ApiUser.sync({ alter: true });
console.log('✅ API用户表同步成功');
// 同步订单表(如果不存在则创建)
await models.Order.sync({ alter: true });
console.log('✅ 订单表同步成功');
console.log('✅ 数据库模型同步完成');
} catch (error) {
console.error('❌ 数据库模型同步失败:', error);