Updated SQL schemas for FOREIGN KEY changes

Was trying to setup freemed too see if it might be adaptable to what I need & ran into trouble with the install.php script erroring when it was attempting to configure the mysql table with MySQL 5.5... Traced the issue to table columns that weren't matching with the FOREIGN KEY maps.