I am trying to add a foreign key using MySQL Workbench. I created a new table and clicked on foreign keys tab and it shows the columns. But the checkbox is not activated. The column is INT data type on both tables. Could you please suggest what could be wrong? I appreciate any help.
CREATE TABLE `temp_table1` (
`t_id` int(10) unsigned NOT NULL,
`t_name` varchar(45) default NULL,
PRIMARY KEY (`t_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
CREATE TABLE `new_table` (
`newid` int(11) NOT NULL,
`t_id` int(10) NOT NULL,
PRIMARY KEY (`newid`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
While both columns are of type
INT, one of them isunsignedas well. They must both beunsignedfor a foreign key to be established.