-- Deploy gaia:doctor_2016_04_05_add_table_notification to mysql

BEGIN;

CREATE TABLE `doctor_notification` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `doctor_id` varchar(64) NOT NULL,
    `summary` varchar(100) NOT NULL,
    `ntype` varchar(2) NOT NULL,
    `person_id` varchar(64) NOT NULL,
    `related_item_id` varchar(64) NOT NULL,
    `related_item_type` varchar(2) NOT NULL,
    `related_item_sub` varchar(64),
    `create_time` datetime(6) NOT NULL,
    `is_viewed` bool NOT NULL
);

CREATE INDEX `doctor_notification_f4e70f0f` ON `doctor_notification` (`doctor_id`, `ntype`, `person_id`, `related_item_id`);

COMMIT;
