[eluser]weboide[/eluser]
I believe that for a foreign key to be optional, it has to be possible to set it to NULL (ie without NOT NULL).
Try with parent_id like this:
Code:
`parent_id` int(10) unsigned DEFAULT NULL
If there is no parent, just set parent_id to NULL or do not set it (as it is by default set to NULL)