CREATE TABLE tblmodule_taxes(
    id BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    tenant_id BIGINT UNSIGNED NOT NULL,
    rel_id BIGINT UNSIGNED NOT NULL,
    rel_type ENUM('estimate', 'invoice') NOT NULL,
    taxrate DECIMAL NOT NULL,
    taxname VARCHAR(100) NOT NULL,
    amount DECIMAL NOT NULL,
    added_on DATETIME
);

ALTER TABLE tblestimates ADD COLUMN tax_type ENUM ('global', 'for_item') DEFAULT 'for_item' AFTER total_tax;
ALTER TABLE tblinvoices ADD COLUMN tax_type ENUM ('global', 'for_item') DEFAULT 'for_item' AFTER total_tax;