In my MySQL query I'm getting "Cannot add foreign key constraint error", what could be the reason? -
in mysql query i'm getting error:
cannot add foreign key constraint error
what reason?
create table `social_account` ( `id` int(11) not null auto_increment, `user_id` int(11) default null, `type` enum('facebook','twitter') default null, `pageid` varchar(200) default null, `accesstoken` varchar(200) default null, `pagename` varchar(200) default null, `profilepicture` varchar(200) default null, `page_url` varchar(300) default null, `accesstokensecreat` varchar(200) default null, `is_expire` int(1) default '0', primary key (`id`), key `fk_user_social_account` (`user_id`), constraint `fk_user_social_account` foreign key (`user_id`) references `user` (`id`) ) engine=innodb auto_increment=2 default charset=utf8mb4
may foreign key datatype not matched referring table
Comments
Post a Comment