[1.7.x] Fixed #23013 -- Fixed removing unique_together/index_together constraints in migrations.

Thanks melinath for the report.

Backport of 0154965392 from master