修改定时任务唯一键

This commit is contained in:
whyour
2022-01-30 10:11:47 +08:00
parent a726f224f8
commit 57fd8f378c
2 changed files with 13 additions and 6 deletions
+10 -4
View File
@@ -49,12 +49,18 @@ export enum CrontabStatus {
interface CronInstance extends Model<Crontab, Crontab>, Crontab {}
export const CrontabModel = sequelize.define<CronInstance>('Crontab', {
name: DataTypes.STRING,
command: {
unique: 'command',
name: {
unique: 'compositeIndex',
type: DataTypes.STRING,
},
command: {
unique: 'compositeIndex',
type: DataTypes.STRING,
},
schedule: {
unique: 'compositeIndex',
type: DataTypes.STRING,
},
schedule: DataTypes.STRING,
timestamp: DataTypes.STRING,
saved: DataTypes.BOOLEAN,
status: DataTypes.NUMBER,