This commit is contained in:
张成
2025-11-26 12:39:21 +08:00
parent 5d59000960
commit 7858459118
12 changed files with 1785 additions and 2 deletions

86
api/model/version_info.js Normal file
View File

@@ -0,0 +1,86 @@
const Sequelize = require('sequelize');
/**
* 版本信息表模型
* 存储应用版本信息,支持多平台多架构
*/
module.exports = (db) => {
const version_info = db.define("version_info", {
// 版本基本信息
version: {
comment: '版本号x.y.z 格式)',
type: Sequelize.STRING(20),
allowNull: false
},
platform: {
comment: '平台类型win32/darwin/linux',
type: Sequelize.STRING(20),
allowNull: false
},
arch: {
comment: '架构类型x64/ia32/arm64',
type: Sequelize.STRING(20),
allowNull: false
},
// 文件信息
download_url: {
comment: '下载地址',
type: Sequelize.STRING(500),
allowNull: false
},
file_path: {
comment: '服务器文件路径',
type: Sequelize.STRING(500),
allowNull: false
},
file_size: {
comment: '文件大小(字节)',
type: Sequelize.BIGINT,
allowNull: true,
defaultValue: 0
},
file_hash: {
comment: 'SHA256 哈希值',
type: Sequelize.STRING(64),
allowNull: true
},
// 更新信息
release_notes: {
comment: '更新日志',
type: Sequelize.TEXT,
allowNull: true
},
force_update: {
comment: '是否强制更新1:是 0:否)',
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 0
},
// 状态信息
status: {
comment: '状态1:启用 0:禁用)',
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 1
},
}, {
timestamps: false,
indexes: [
{
unique: true,
fields: ['version', 'platform', 'arch']
},
{
unique: false,
fields: ['platform', 'arch', 'status']
}
]
});
return version_info;
};