This looks for PK/UQ constraints with the same columns in the same order in the constraint. It produces the SQL to drop the duplicates.