Files
autoAiWorkSys/api/model/win_version_info.js
张成 ab8179713c 1
2025-11-28 14:22:26 +08:00

87 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const Sequelize = require('sequelize');
/**
* 版本信息表模型
* 存储应用版本信息,支持多平台多架构
*/
module.exports = (db) => {
const win_version_info = db.define("win_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 win_version_info;
};