Adds migration for work package journals.

Foreign keys of journals now get the content of the new work package.
This previously broke planning element journals.
Adds proper error for MySQL.