-- Deploy gaia:2017_09_27_add_statement_refused_record to mysql

BEGIN;

CREATE TABLE `pay_statementrefusedrecord` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `statement_id` varchar(15) NOT NULL,
    `reason` varchar(140) NOT NULL,
    `create_time` datetime(6) NOT NULL
)
;
ALTER TABLE `pay_statementrefusedrecord` ADD CONSTRAINT `statement_id_refs_id_c097155b` FOREIGN KEY (`statement_id`) REFERENCES `pay_statement` (`id`);

ALTER TABLE `api_doctoraccount` ADD `subbranch` CHAR(100) NULL;
ALTER TABLE `pay_statementaccount` ADD `subbranch` CHAR(100) NULL;

ALTER TABLE `pay_statement` ADD `merchant_confirm_time` datetime(6) NULL;
ALTER TABLE `pay_statement` ADD `settle_time` datetime(6) NULL;

COMMIT;
