-- Remove duplicate foreign key constraints added in migration 20251105193953
-- Keep the original _fkey constraints that were already working

-- Drop the duplicate park_submission constraint (keep submission_items_park_submission_id_fkey)
ALTER TABLE submission_items
  DROP CONSTRAINT IF EXISTS fk_submission_items_park_submission;

-- Drop the duplicate ride_submission constraint (keep submission_items_ride_submission_id_fkey)
ALTER TABLE submission_items
  DROP CONSTRAINT IF EXISTS fk_submission_items_ride_submission;

-- Drop the duplicate company_submission constraint (keep submission_items_company_submission_id_fkey)
ALTER TABLE submission_items
  DROP CONSTRAINT IF EXISTS fk_submission_items_company_submission;

-- Drop the duplicate ride_model_submission constraint (keep submission_items_ride_model_submission_id_fkey)
ALTER TABLE submission_items
  DROP CONSTRAINT IF EXISTS fk_submission_items_ride_model_submission;

-- Drop the duplicate photo_submission constraint (keep submission_items_photo_submission_id_fkey)
ALTER TABLE submission_items
  DROP CONSTRAINT IF EXISTS fk_submission_items_photo_submission;

-- Drop the duplicate timeline_event_submission constraint (keep submission_items_timeline_event_submission_id_fkey)
ALTER TABLE submission_items
  DROP CONSTRAINT IF EXISTS fk_submission_items_timeline_event_submission;

COMMENT ON TABLE submission_items IS 
  'Submission items with single foreign key constraints to various submission types. Original _fkey constraints maintained.';