Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
fix: fix duplicate foreign key constraint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Crazyokd committed Mar 11, 2023
1 parent 3185455 commit 6822a11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ create table if not exists `message` (
`create_time` timestamp default current_timestamp comment '消息发送时间',
`update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间',
primary key `pk_id` (`id`),
constraint `fk_from_id` foreign key (`from_id`) references `user` (`id`) on delete cascade
constraint `fk_message_from_id` foreign key (`from_id`) references `user` (`id`) on delete cascade
) ENGINE=InnoDB DEFAULT charset=utf8mb4;


Expand Down Expand Up @@ -95,7 +95,7 @@ create table if not exists `remark` (
`create_time` timestamp default current_timestamp comment '创建时间',
`update_time` timestamp default current_timestamp on update current_timestamp comment '更新时间',
primary key `pk_id` (`id`),
constraint `fk_from_id` foreign key (`from_id`) references `user` (`id`) on delete cascade
constraint `fk_remark_from_id` foreign key (`from_id`) references `user` (`id`) on delete cascade
) engine=InnoDB auto_increment=501 default charset=utf8mb4 comment="备注表";

set foreign_key_checks = 1;

0 comments on commit 6822a11

Please sign in to comment.