create table tb_user
(user_id
int(100) not null auto_increment,user_name
varchar(200) not null default'',user_password
varchar(1000)not null,user_phone
varchar(1000),user_type
int(10)not null,user_email
varchar(2000) not null,user_img
varchar(2000) default null,create_time
datetime default null,last_edit_time
datetime default null,
primary key(user_id
)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
create table tb_lost
(lost_id
int(100)not null auto_increment,lost_type
varchar(2000) not null,lost_place
varchar(2000)not null,lost_user_id
int(100)not null,lost_user_name
varchar(2000)not null,lost_phone
varchar(1000) not null,lost_time
varchar(2000) not null,take_time
varchar(2000) not null,lost_img
varchar(2000) not null,
primary key(lost_id
),
constraint fk_lostuser_id
foreign key(lost_user_id
) references tb_user
(user_id
)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
create table tb_pick
(pick_id
int(100)not null auto_increment,pick_type
varchar(2000) not null,pick_place
varchar(2000)not null,pick_user_id
int(100)not null,pick_user_name
varchar(2000)not null,pick_phone
varchar(1000) not null,pick_time
varchar(2000) not null,take_time
varchar(2000) not null,pick_img
varchar(2000) not null,
primary key(pick_id
),
constraint fk_pcikuser_id
foreign key(pick_user_id
) references tb_user
(user_id
)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
create table ly_info
(ly_info_id
int(100)not null auto_increment,ly_user_id
int(100)not null,ly_txt
varchar(2000)not null,ly_time
varchar(2000)not null,
primary key(ly_info_id
),
constraint fk_ly_id
foreign key(ly_user_id
) referencestb_user
(user_id
)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
create table hf_info
(hf_id
int(100)not null auto_increment,hf_info_id
int(100)not null,hf_user_id
int(100)not null,hf_txt
varchar(2000)not null,hf_time
varchar(2000)not null,
primary key(hf_info_id
),
constraint hf_info_id
foreign key(ly_info_id
)referencesly_info
(hf_info_id
),
constraintfk_hf_id
foreign key(hf_user_id
)referencestb_user
(hf_user_id
)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
create table gg_info
(gg_id
int(100)not null auto_increment,gg_txt
varchar(2000)not null,gg_time
datetime not null,
primary key(gg_id
)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
第四张表的约束外键约束有问题,为什么