Added method to check if migration is needed.