Add Foreign-key relations to the database

* Required for a good grade on database design.
* Has to update datatypes for fields that were not correctly created.
vendor stuff