[WIP] Fix/mysql migration

Includes https://github.com/opf/openproject/pull/673.