-- Try modifying columns first, then dropping index
-- Run these in order:

-- STEP 1: Disable foreign key checks
SET FOREIGN_KEY_CHECKS = 0;

-- STEP 2: Try to modify columns (this might remove inline foreign keys)
ALTER TABLE `bids` 
  MODIFY COLUMN `inquiryId` INT NOT NULL,
  MODIFY COLUMN `supplierId` INT NOT NULL;

-- STEP 3: Drop the unique index
ALTER TABLE `bids` DROP INDEX `bids_inquiry_id_supplier_id`;

-- STEP 4: Re-enable foreign key checks
SET FOREIGN_KEY_CHECKS = 1;

-- STEP 5: Recreate foreign keys explicitly
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 6: Verify
SHOW INDEX FROM `bids` WHERE Column_name IN ('inquiryId', 'supplierId');
-- Should only see Non_unique = 1

