Rails 删除数据库关联记录(外键)

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

drop database Contact;

create database Contact;

use Contact;

CREATE TABLE Employee (
   id  int unsigned not null auto_increment primary key,
   Name VARCHAR(50),
   Phone VARCHAR(15),
   departmentId int
);


CREATE TABLE Department(
   id    int unsigned not null auto_increment primary key,
   Name VARCHAR(50),
   Phone VARCHAR(15)
   
);