-- Find the COMPOSITE unique index (both inquiryId AND supplierId together)
-- This is different from individual column indexes

-- Method 1: Show all indexes
SHOW INDEX FROM `bids`;

-- Look for:
-- - A Key_name that appears TWICE (once for inquiryId, once for supplierId)
-- - Both rows have the SAME Key_name
-- - Both rows have Non_unique = 0 (UNIQUE)
-- - The Seq_in_index will be 1 for inquiryId and 2 for supplierId

-- Method 2: More specific query
SELECT 
    INDEX_NAME as Key_name,
    GROUP_CONCAT(COLUMN_NAME ORDER BY SEQ_IN_INDEX) as Columns,
    NON_UNIQUE
FROM INFORMATION_SCHEMA.STATISTICS
WHERE TABLE_SCHEMA = DATABASE()
  AND TABLE_NAME = 'bids'
  AND COLUMN_NAME IN ('inquiryId', 'supplierId')
GROUP BY INDEX_NAME, NON_UNIQUE
HAVING COUNT(DISTINCT COLUMN_NAME) = 2  -- Both columns must be in this index
  AND NON_UNIQUE = 0;  -- Must be unique

-- This will show you the composite unique index name
-- Use that name in: ALTER TABLE `bids` DROP INDEX `INDEX_NAME_FROM_ABOVE`;

