Can't write; duplicate key in table 'QRTZ_TRIGGERS'
- 原sql
create table QRTZ_TRIGGERS (
sched_name varchar(120) not null comment '调度名称',
trigger_name varchar(200) not null comment '触发器的名字',
trigger_group varchar(200) not null comment '触发器所属组的名字',
job_name varchar(200) not null comment 'qrtz_job_details表job_name的外键',
job_group varchar(200) not null comment 'qrtz_job_details表job_group的外键',
description varchar(250) null comment '相关介绍',
next_fire_time bigint(13) null comment

这篇博客介绍了如何创建和修改SQL数据库表,特别是关注外键约束的设置。原始SQL创建了一个名为QRTZ_TRIGGERS的表,但在尝试写入时遇到了重复键错误。修改后的SQL通过添加`constraint`关键字来明确外键约束,避免了冲突,确保了数据的一致性和完整性。
最低0.47元/天 解锁文章
3819





