-- Deploy gaia:pay_2017_03_01_create_statementaccount to mysql

BEGIN;

CREATE TABLE `pay_statementaccount` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `statement_id` varchar(15) NOT NULL UNIQUE,
    `province_id` varchar(40),
    `city_id` varchar(40),
    `bank` varchar(30) NOT NULL,
    `account_name` varchar(30) NOT NULL,
    `account_number` varchar(50) NOT NULL,
    `account_type` integer NOT NULL
)
;
ALTER TABLE `pay_statementaccount` ADD CONSTRAINT `city_id_refs_id_e0fd4563` FOREIGN KEY (`city_id`) REFERENCES `api_city` (`id`);
ALTER TABLE `pay_statementaccount` ADD CONSTRAINT `statement_id_refs_id_317a2150` FOREIGN KEY (`statement_id`) REFERENCES `pay_statement` (`id`);
ALTER TABLE `pay_statementaccount` ADD CONSTRAINT `province_id_refs_id_cfaaa857` FOREIGN KEY (`province_id`) REFERENCES `api_province` (`id`);

COMMIT;
