-- Deploy gaia:2019-11-07-famous_doctors to mysql

BEGIN;

CREATE TABLE `api_famousdoctorregisteritem` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_online` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `is_deleted` bool NOT NULL,
    `register_id` bigint NOT NULL,
    `item_id` bigint NOT NULL,
    `vote_count` integer NOT NULL,
    `final_count` integer NOT NULL
);
CREATE INDEX `api_famousdoctorregisteritem_ae299483` ON `api_famousdoctorregisteritem` (`register_id`);
CREATE INDEX `api_famousdoctorregisteritem_82bfda79` ON `api_famousdoctorregisteritem` (`item_id`);

CREATE TABLE `api_famous_doctors_vote` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_online` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `is_deleted` bool NOT NULL,
    `item_id` bigint NOT NULL,
    `register_id` bigint NOT NULL,
    `user_id` bigint NOT NULL,
    `platform` varchar(3) NOT NULL
);
CREATE INDEX `api_famous_doctors_vote_82bfda79` ON `api_famous_doctors_vote` (`item_id`);
CREATE INDEX `api_famous_doctors_vote_ae299483` ON `api_famous_doctors_vote` (`register_id`);
CREATE INDEX `api_famous_doctors_vote_e8701ad4` ON `api_famous_doctors_vote` (`user_id`);

CREATE TABLE `api_famous_doctors_registrationer` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_online` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `is_deleted` bool NOT NULL,
    `doctor_id` varchar(200) NOT NULL,
    `doctor_type` integer NOT NULL

);
CREATE INDEX `api_famous_doctors_registrationer_d4d6bd50` ON `api_famous_doctors_registrationer` (`doctor_id`);

COMMIT;
