-- Deploy gaia:2017_09_30_doctor_punishment to mysql

BEGIN;

CREATE TABLE `api_punishment` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `doctor_id` varchar(100) NOT NULL,
    `reason` varchar(32) NOT NULL,
    `start_time` datetime(6) NOT NULL,
    `end_time` datetime(6) NOT NULL,
    `comment` varchar(256) NOT NULL,
    `enable` bool NOT NULL,
    `create_time` datetime(6) NOT NULL
)
;
ALTER TABLE `api_punishment` ADD CONSTRAINT `doctor_id_refs_id_b7d893cc` FOREIGN KEY (`doctor_id`) REFERENCES `api_doctor` (`id`);
CREATE INDEX `api_punishment_72821be1` ON `api_punishment` (`doctor_id`);

COMMIT;
