Fix legacy_id issue on migration (I think).