-- ============================================
-- ALTERNATIVE METHOD: Using SHOW CREATE TABLE
-- If Step 1 doesn't show constraint names, use this
-- ============================================

-- STEP 1: Get the full table structure
-- Run this and look at the output:
SHOW CREATE TABLE `bids`;

-- In the output, look for lines like:
-- CONSTRAINT `something` FOREIGN KEY (`inquiryId`) REFERENCES `inquiries` (`id`)
-- CONSTRAINT `something_else` FOREIGN KEY (`supplierId`) REFERENCES `suppliers` (`id`)

-- Note the constraint names (the part after CONSTRAINT and before FOREIGN KEY)

-- STEP 2: Drop those constraints using the names from Step 1
-- Example:
-- ALTER TABLE `bids` DROP FOREIGN KEY `constraint_name_from_step_1`;
-- ALTER TABLE `bids` DROP FOREIGN KEY `constraint_name_from_step_2`;

-- STEP 3: Drop the unique index
ALTER TABLE `bids` DROP INDEX `bids_inquiry_id_supplier_id`;

-- STEP 4: Recreate foreign keys
ALTER TABLE `bids` 
  ADD CONSTRAINT `bids_inquiryId_fk` FOREIGN KEY (`inquiryId`) REFERENCES `inquiries` (`id`) ON DELETE CASCADE;

ALTER TABLE `bids` 
  ADD CONSTRAINT `bids_supplierId_fk` FOREIGN KEY (`supplierId`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE;

-- STEP 5: Create non-unique index
CREATE INDEX `idx_bids_inquiry_supplier` ON `bids` (`inquiryId`, `supplierId`);

-- STEP 6: Verify
SHOW INDEX FROM `bids` WHERE Column_name IN ('inquiryId', 'supplierId`);

