--liquibase formatted sql
--changeset {patrick}:{86b9a87e-ca5a-4b56-bba6-2a4ec7e88aeb}

CREATE TABLE IF NOT EXISTS `account_shipper_overrides` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `state_code` VARCHAR(2) NULL,
  `organization_id` INT NOT NULL,
  `group_id` INT NOT NULL,
  `location_id` INT NOT NULL,
  `shipper_id` INT NOT NULL,
  `timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`));

INSERT INTO `location` (`external_id`, `name`, `group_id`) VALUES ('07702611', 'CLARK’S TRUCK CENTER', 1);
INSERT INTO `location` (`external_id`, `name`, `group_id`) VALUES ('07761061', 'CAROLINA INTL TRUCKS', 1);

INSERT INTO `account_shipper_overrides` (`state_code`,`organization_id`,`group_id`,`location_id`,`shipper_id`) VALUES ('',29,1,1,9);
INSERT INTO `account_shipper_overrides` (`state_code`,`organization_id`,`group_id`,`location_id`,`shipper_id`) VALUES ('',29,1,2,1);
INSERT INTO `account_shipper_overrides` (`state_code`,`organization_id`,`group_id`,`location_id`,`shipper_id`) VALUES ('',29,1,3,9);

--CLARK’S TRUCK CENTER 07702611 - Carrier needs to be FedEx
INSERT INTO `account_shipper_overrides` (`state_code`,`organization_id`,`group_id`,`location_id`,`shipper_id`) 
SELECT '',29,1,id,9 FROM `location` WHERE `external_id` = '07702611';
--CAROLINA INTL TRUCKS 07761061 - Carrier needs to be YRC
INSERT INTO `account_shipper_overrides` (`state_code`,`organization_id`,`group_id`,`location_id`,`shipper_id`)
SELECT '',29,1,id,1 FROM `location` WHERE `external_id` = '07761061';


