mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修改filterRelation字段限制
This commit is contained in:
parent
91dbb7770d
commit
734cc94048
|
@ -46,6 +46,10 @@ export const CrontabViewModel = sequelize.define<CronViewInstance>(
|
|||
isDisabled: DataTypes.NUMBER,
|
||||
filters: DataTypes.JSON,
|
||||
sorts: DataTypes.JSON,
|
||||
filterRelation: { type: DataTypes.STRING, defaultValue: 'and' },
|
||||
filterRelation: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
defaultValue: 'and',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
|
|
@ -15,17 +15,6 @@ export default async () => {
|
|||
const envService = Container.get(EnvService);
|
||||
const dependenceService = Container.get(DependenceService);
|
||||
|
||||
// 更新所有不存在filterRelation的任务视图
|
||||
const views = await CrontabViewModel.findAll({ where: {}, raw: true });
|
||||
for (const view of views) {
|
||||
if (!view.filterRelation) {
|
||||
await CrontabViewModel.update(
|
||||
{ filterRelation: 'and' },
|
||||
{ where: { id: view.id } },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化更新所有任务状态为空闲
|
||||
await CrontabModel.update(
|
||||
{ status: CrontabStatus.idle },
|
||||
|
|
Loading…
Reference in New Issue
Block a user