Fixed the foreign key problem, now to make some changes for the categories to work