DROP TABLE IF EXISTS `supplierinvoicedoc`;
CREATE TABLE `supplierinvoicedoc` (
    `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `supplierId` int(10) UNSIGNED NOT NULL,
    `supplierInvoiceNo` varchar(50) NOT NULL DEFAULT '',
    `assetId` varchar(32) NOT NULL DEFAULT '',
    `syncedWithXero` tinyint(1) NOT NULL DEFAULT 0,
    `xeroId` varchar(50) NOT NULL DEFAULT '',
    `active` tinyint(1) NOT NULL DEFAULT 1,
    `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdById` int(10) UNSIGNED NOT NULL DEFAULT 10 ,
    `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updatedById` int(10) UNSIGNED NOT NULL DEFAULT 10,
    PRIMARY KEY (`id`),
    INDEX `supplierId` (`supplierId`) USING BTREE,
    INDEX `supplierInvoiceNo` (`supplierInvoiceNo`) USING BTREE,
    INDEX `assetId` (`assetId`) USING BTREE,
    INDEX `syncedWithXero` (`syncedWithXero`) USING BTREE,
    INDEX `xeroId` (`xeroId`) USING BTREE,
    INDEX `active` (`active`) USING BTREE,
    INDEX `createdById` (`createdById`) USING BTREE,
    INDEX `updatedById` (`updatedById`) USING BTREE
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

ALTER TABLE `receivingitem` ADD COLUMN `xeroId`  varchar(50) NOT NULL DEFAULT '' AFTER `syncedWithXero`;
ALTER TABLE `receivingitem` ADD INDEX(`xeroId`);

