Fix migration to current version of database structure.