-- Deploy gaia:2016_07_05_add_table_yd_case to mysql

BEGIN;

CREATE TABLE `api_youngdoctorcase` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `doctor_id` varchar(100),
    `case_type` integer NOT NULL,
    `doctor_name` varchar(200) DEFAULT NULL,
    `preoperartion_front_image` varchar(128) NOT NULL,
    `preoperartion_side_image` varchar(128) NOT NULL,
    `postoperartion_front_image` varchar(128) NOT NULL,
    `postoperartion_side_image` varchar(128) NOT NULL,
    `description` longtext NOT NULL,
    `is_online` bool NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `last_modified_time` datetime(6) NOT NULL
)
;
ALTER TABLE `api_youngdoctorcase` ADD CONSTRAINT `doctor_id_refs_id_3d34526b` FOREIGN KEY (`doctor_id`) REFERENCES `api_doctor` (`id`);
CREATE INDEX `api_youngdoctorcase_fc5484aa` ON `api_youngdoctorcase` (`doctor_name`);
COMMIT;
