CREATE TABLE tb_user_role
(
id int auto_increment PRIMARY KEY,
user_id int,
role_id int,
CONSTRAINT fk_user
FOREIGN KEY(user_id) REFERENCES tb_user(id),
CONSTRAINT fk_role
FOREIGN KEY(role_id) REFERENCES tb_role(id)
);
MySQL:外键
最新推荐文章于 2024-03-25 22:10:16 发布