-- Deploy gaia:create_table_diary_score to mysql

BEGIN;

CREATE TABLE `api_diaryrank` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `diary_id` integer NOT NULL UNIQUE,
    `heat_score` double precision NOT NULL
)
;
ALTER TABLE `api_diaryrank` ADD CONSTRAINT `diary_id_refs_id_b27e95b0` FOREIGN KEY (`diary_id`) REFERENCES `api_diary` (`id`);

CREATE TABLE `api_doctorcountrecord` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `doctor_id` varchar(100) NOT NULL,
    `discount` integer NOT NULL
)
;
ALTER TABLE `api_doctorcountrecord` ADD CONSTRAINT `doctor_id_refs_id_0e2c2740` FOREIGN KEY (`doctor_id`) REFERENCES `api_doctor` (`id`);

COMMIT;
