-- Deploy gaia:doctor_2017_05_03_add_account_record to mysql

BEGIN;

CREATE TABLE `doctor_doctoraccountrecord` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `account_id` integer NOT NULL,
    `status` integer NOT NULL,
    `reject_reason` varchar(100),
    `handler_id` char(32),
    `created_at` datetime(6) NOT NULL,
    `content` longtext NOT NULL
)
;
ALTER TABLE `doctor_doctoraccountrecord` ADD CONSTRAINT `account_id_refs_id_64d23823` FOREIGN KEY (`account_id`) REFERENCES `api_doctoraccount` (`id`);
ALTER TABLE `doctor_doctoraccountrecord` ADD CONSTRAINT `handler_id_refs_id_d4835b8e` FOREIGN KEY (`handler_id`) REFERENCES `api_person` (`id`);

ALTER TABLE `api_doctoraccount` ADD COLUMN `status` integer NOT NULL;

COMMIT;
