ALTER TABLE `rooms101_rtsdev`.`sales`
    MODIFY COLUMN `dsdate` datetime NULL DEFAULT NULL AFTER `pwprobflag`,
    ADD COLUMN `signed` tinyint(1) NULL AFTER `dsdl`;

update sales u
    left join sales s on s.sales_id = u.sales_id
set s.signed = 1
where u.ds = '1';


ALTER TABLE `rooms101_rtsdev`.`sales`
    MODIFY COLUMN `tourlocation_id` int(11) NULL DEFAULT 0 AFTER `destination_id`,
    MODIFY COLUMN `addon` tinyint(4) NULL DEFAULT 0 AFTER `tourlocation_id`,
    MODIFY COLUMN `carrental` tinyint(1) NULL DEFAULT 0 AFTER `addon`,
    MODIFY COLUMN `insurance` tinyint(2) NULL DEFAULT 0 AFTER `carrental`,
    MODIFY COLUMN `flight` tinyint(4) NULL DEFAULT 0 AFTER `insurance`,
    MODIFY COLUMN `flight_id` int(11) NULL DEFAULT 0 AFTER `flight`,
    MODIFY COLUMN `cruise` tinyint(4) NULL DEFAULT 0 AFTER `flight_id`,
    MODIFY COLUMN `cruise_id` int(11) NULL DEFAULT 0 AFTER `cruise`,
    MODIFY COLUMN `promo_id` int(11) NULL DEFAULT 0 AFTER `cruise_id`,
    MODIFY COLUMN `arrivaldate` date NULL AFTER `salescreate_date`,
    MODIFY COLUMN `departdate` date NULL AFTER `arrivaldate`,
    MODIFY COLUMN `nights` int(11) NULL DEFAULT 0 AFTER `departdate`,
    MODIFY COLUMN `canceldate` date NULL AFTER `nights`,
    MODIFY COLUMN `partysize` int(11) NULL DEFAULT 0 AFTER `canceldate`,
    MODIFY COLUMN `adults` int(11) NULL DEFAULT 0 AFTER `partysize`,
    MODIFY COLUMN `children` int(11) NULL DEFAULT 0 AFTER `adults`,
    MODIFY COLUMN `childage1` int(11) NULL DEFAULT 0 AFTER `children`,
    MODIFY COLUMN `childage2` int(11) NULL DEFAULT 0 AFTER `childage1`,
    MODIFY COLUMN `childage3` int(11) NULL DEFAULT 0 AFTER `childage2`,
    MODIFY COLUMN `childage4` int(11) NULL DEFAULT 0 AFTER `childage3`,
    MODIFY COLUMN `combinedincome` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '' AFTER `childage4`,
    MODIFY COLUMN `occ1` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '' AFTER `combinedincome`,
    MODIFY COLUMN `occ2` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '' AFTER `occ1`,
    MODIFY COLUMN `qualified` tinyint(4) NULL DEFAULT 0 AFTER `occdob`,
    MODIFY COLUMN `roomtype` int(11) NULL DEFAULT 0 AFTER `qualified`,
    MODIFY COLUMN `tour` tinyint(4) NULL DEFAULT 0 AFTER `roomtype`,
    MODIFY COLUMN `tourtime` time NULL DEFAULT '00:00:00' AFTER `tour`,
    MODIFY COLUMN `tourdate` date NULL AFTER `tourtime`,
    MODIFY COLUMN `specialexception` tinyint(50) NULL DEFAULT 0 AFTER `tourdate`,
    MODIFY COLUMN `touredbefore` tinyint(1) NULL DEFAULT 0 AFTER `specialexception`,
    MODIFY COLUMN `subtotal` decimal(9, 2) NULL DEFAULT 0.00 AFTER `tourhandle`,
    MODIFY COLUMN `addcharge` decimal(9, 2) NULL DEFAULT 0.00 AFTER `subtotal`,
    MODIFY COLUMN `tax` decimal(9, 2) NULL DEFAULT 0.00 AFTER `addcharge`,
    MODIFY COLUMN `grandtotal` decimal(9, 2) NULL DEFAULT 0.00 AFTER `insuresubtot`,
    MODIFY COLUMN `paidinfull` tinyint(4) NULL DEFAULT 0 AFTER `grandtotal`,
    MODIFY COLUMN `paidinfulldate` date NULL AFTER `paidinfull`,
    MODIFY COLUMN `approved` tinyint(4) NULL DEFAULT 0 AFTER `paidinfulldate`,
    MODIFY COLUMN `approvedby` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '' AFTER `approved`,
    MODIFY COLUMN `approvedate` date NULL AFTER `approvedby`,
    MODIFY COLUMN `manappprob` tinyint(1) NULL DEFAULT 0 AFTER `approvedate`,
    MODIFY COLUMN `manifested` tinyint(4) NULL DEFAULT 0 AFTER `manappprob`,
    MODIFY COLUMN `pwrecv` tinyint(1) NULL DEFAULT 0 AFTER `manifested`,
    MODIFY COLUMN `pwprobflag` tinyint(4) NULL DEFAULT 0 AFTER `pwrecv`,
    MODIFY COLUMN `manifestdate` date NULL AFTER `ds`,
    MODIFY COLUMN `recvpwdate` date NULL AFTER `manifestdate`,
    MODIFY COLUMN `bogus` tinyint(4) NULL DEFAULT 0 AFTER `recvpwdate`,
    MODIFY COLUMN `bogus_oldcustid` int(50) NULL DEFAULT 0 AFTER `bogus`,
    MODIFY COLUMN `cancelled` tinyint(4) NULL DEFAULT 0 AFTER `bogus_oldcustid`,
    MODIFY COLUMN `bogusdate` date NULL AFTER `cancelled`,
    MODIFY COLUMN `resnumber` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '' AFTER `bogusdate`,
    MODIFY COLUMN `resdate` date NULL AFTER `resnumber`,
    MODIFY COLUMN `manifestchange` tinyint(4) NULL DEFAULT 0 AFTER `resdate`,
    MODIFY COLUMN `confnumber` tinyint(50) NULL DEFAULT 0 AFTER `manifestchange`,
    MODIFY COLUMN `confdate` date NULL AFTER `confnumber`,
    MODIFY COLUMN `confby` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '' AFTER `confdate`,
    MODIFY COLUMN `hotelpaid` tinyint(4) NULL DEFAULT 0 AFTER `confby`,
    MODIFY COLUMN `hbpaiddate` date NULL AFTER `hotelpaid`,
    MODIFY COLUMN `hbcheckid` int(11) NULL DEFAULT 0 AFTER `hbpaiddate`,
    MODIFY COLUMN `tourpaid` tinyint(4) NULL DEFAULT 0 AFTER `hbcheckid`,
    MODIFY COLUMN `touramt` decimal(9, 2) NULL AFTER `tourqual`,
    MODIFY COLUMN `tourpaidby` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '' AFTER `touramt`,
    MODIFY COLUMN `tourpaiddate` date NULL AFTER `tourpaidby`,
    MODIFY COLUMN `wcmanifest` tinyint(4) NULL DEFAULT 0 AFTER `tourpaiddate`,
    MODIFY COLUMN `wcmanifestman` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '0' AFTER `wcmanifest`,
    MODIFY COLUMN `wcpropinfo` tinyint(1) NULL AFTER `wcmanifestman`,
    MODIFY COLUMN `compaid` tinyint(1) NULL DEFAULT 0 AFTER `coverpage`,
    MODIFY COLUMN `partner` tinyint(2) NULL AFTER `hashconf`,
    MODIFY COLUMN `salecompletedate` date NULL AFTER `partner`;
