Use migrations to fix auto_upgrade problems