I am trying to add a self relation in an existing Innodb table here is table structure
Table person person_id int (10) primary key not null auto increment, parent_id int (10) NULL default null, name varchar(30)
When I use this command
ALTER TABLE `person` ADD FOREIGN KEY ( `parent_id` ) REFERENCES `person` (`person_id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;
I get the error data type mismatch. I think this could be due to null values in parent_id. Is there any way to skip this check?
Thanks