修改表唯一约束

This commit is contained in:
whyour committed 2022-01-27 00:49:44 +08:00
1 parent a3a62f65dd
commit 891619ad55
7 files changed
+23 -15

No files matched your search

-6
View File
@@ -31,12 +31,6 @@ export default class CronService {
}
public async insert(payload: Crontab): Promise<Crontab> {
const cron = await CrontabModel.findOne({
where: { command: payload.command },
});
if (cron) {
return cron;
}
return await CrontabModel.create(payload, { returning: true });
}