Add foreign keys to the Mysql-scheme

Also, add a .sql file that will create the foreign keys on existing databases. But only AFTER the 3.x_to_3.4.0-scripts are run.