修复sqlite数据操作类型

This commit is contained in:
whyour
2022-01-08 01:09:38 +08:00
parent 89ed8527d6
commit e75a683173
21 changed files with 199 additions and 217 deletions
+2 -13
View File
@@ -14,7 +14,7 @@ export class Crontab {
isDisabled?: 1 | 0;
log_path?: string;
isPinned?: 1 | 0;
labels: Array<string>;
labels?: string[];
last_running_time?: number;
last_execution_time?: number;
@@ -60,18 +60,7 @@ export const CrontabModel = sequelize.define<CronInstance>('Crontab', {
isDisabled: DataTypes.NUMBER,
isPinned: DataTypes.NUMBER,
log_path: DataTypes.STRING,
labels: {
type: DataTypes.STRING,
allowNull: false,
get() {
if (this.getDataValue('labels')) {
return this.getDataValue('labels').split(',')
}
},
set(value) {
this.setDataValue('labels', value.join(','));
},
},
labels: DataTypes.JSON,
last_running_time: DataTypes.NUMBER,
last_execution_time: DataTypes.NUMBER,
});
+2 -2
View File
@@ -55,9 +55,9 @@ export const DependenceModel = sequelize.define<DependenceInstance>(
'Dependence',
{
name: DataTypes.STRING,
type: DataTypes.STRING,
type: DataTypes.NUMBER,
timestamp: DataTypes.STRING,
status: DataTypes.STRING,
status: DataTypes.NUMBER,
log: DataTypes.JSON,
remark: DataTypes.STRING,
},