Fixed #23452 -- Prevented infinite migrations for empty unique/index_together.

Thanks fwkroon for the report.