The source of the problem is not the migrate but the flush command. Updated the flush command to only call loaddata for unmigrated_apps