The migration was dropping the constraint but not the underlying unique index.
In PostgreSQL, unique constraints and unique indexes can exist independently.
This caused auto-enrollment to fail with 'unique constraint violated' errors.
Added explicit DROP INDEX statement to ensure the unique index is removed,
allowing duplicate friendly_name values while machine_id remains unique.