`trans_no` int(11) unsigned NOT NULL DEFAULT '0',
`type` smallint(6) unsigned NOT NULL DEFAULT '0',
`version` tinyint(1) unsigned NOT NULL DEFAULT '0',
- `debtor_no` int(11) unsigned DEFAULT NULL,
+ `debtor_no` int(11) unsigned NOT NULL,
`branch_code` int(11) NOT NULL DEFAULT '-1',
`tran_date` date NOT NULL DEFAULT '0000-00-00',
`due_date` date NOT NULL DEFAULT '0000-00-00',
CREATE TABLE IF NOT EXISTS `0_supp_trans` (
`trans_no` int(11) unsigned NOT NULL DEFAULT '0',
`type` smallint(6) unsigned NOT NULL DEFAULT '0',
- `supplier_id` int(11) unsigned DEFAULT NULL,
+ `supplier_id` int(11) unsigned NOT NULL,
`reference` tinytext NOT NULL,
`supp_reference` varchar(60) NOT NULL DEFAULT '',
`tran_date` date NOT NULL DEFAULT '0000-00-00',
`rate` double NOT NULL DEFAULT '1',
`alloc` double NOT NULL DEFAULT '0',
`tax_included` tinyint(1) NOT NULL DEFAULT '0',
- PRIMARY KEY (`type`,`trans_no`),
+ PRIMARY KEY (`type`,`trans_no`,`supplier_id`),
KEY `supplier_id` (`supplier_id`),
KEY `tran_date` (`tran_date`)
) ENGINE=InnoDB;