     account_record_id int(11) unsigned default null,
     tenant_record_id int(11) unsigned default null,
     PRIMARY KEY (record_id)
-) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+);
 CREATE UNIQUE INDEX payments_id ON payments(id);
 CREATE INDEX payments_inv ON payments(invoice_id);
 CREATE INDEX payments_accnt ON payments(account_id);

    account_record_id int(11) unsigned default null,
    tenant_record_id int(11) unsigned default null,
    PRIMARY KEY(record_id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE INDEX payment_attempt_history_target_record_id ON payment_attempt_history(target_record_id);
CREATE INDEX payment_attempt_history_tenant_account_record_id ON payment_attempt_history(tenant_record_id, account_record_id);


CREATE TABLE refunds (
    record_id int(11) unsigned NOT NULL AUTO_INCREMENT,
    id char(36) NOT NULL,
    account_id char(36) NOT NULL,
    payment_id char(36) NOT NULL,
    amount numeric(10,4),
    currency char(3),
    is_adjusted tinyint(1),
    refund_status varchar(50), 
    created_by varchar(50) NOT NULL,
