-- Manual UP only: OCR deployment settings on `configocrdeployment`
-- Combines Version20260513183000 + Version20260513212700 (no DOWN).

-- Version20260513183000: unmatched customer fallback + default shipper FK
ALTER TABLE `configocrdeployment`
  ADD `allow_unmatched_customer_creation` TINYINT(1) NOT NULL DEFAULT 0,
  ADD `default_shipper_customer_id` INT NULL DEFAULT NULL;

CREATE INDEX `IDX_CONFIGOCRDEPLOYMENT_DEFAULT_SHIPPER`
  ON `configocrdeployment` (`default_shipper_customer_id`);

ALTER TABLE `configocrdeployment`
  ADD CONSTRAINT `FK_CONFIGOCRDEPLOYMENT_DEFAULT_SHIPPER`
  FOREIGN KEY (`default_shipper_customer_id`)
  REFERENCES `customer` (`id`)
  ON DELETE SET NULL;

-- Version20260513212700: ambiguous shipper match policy
ALTER TABLE `configocrdeployment`
  ADD `ambiguous_shipper_match_action` VARCHAR(32) NOT NULL DEFAULT 'use_highest_score';
