Fix for database migration