Minor optimization of the database migration