mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 09:45:36 +08:00
修改表唯一约束
This commit is contained in:
1 parent
a3a62f65dd
commit
891619ad55
7 files changed
+23
-15
No files matched your search
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user