CREATE TABLE ChartAccount
(
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    TransactionId BIGINT UNSIGNED DEFAULT NULL,
    Reference BIGINT UNSIGNED DEFAULT NULL,
    Account BIGINT UNSIGNED DEFAULT NULL,
    Amount DECIMAL(10,2) NOT NULL,
    ts BIGINT UNSIGNED NOT NULL,
    PRIMARY KEY ( id ),
    UNIQUE KEY TransactionId_2 ( TransactionId,Account ),
    KEY TransactionId ( TransactionId ),
    KEY ts ( ts,id ),
    KEY Reference ( Reference )

) ENGINE=INNODB CHARSET=UTF8;
