-- Deploy gaia:api_2015_12_16_create_table_api_recommend_doctor to mysql

BEGIN;

CREATE TABLE `api_recommend_doctor` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
	`person_id` char(32) NOT NULL,
    `diary_id` integer,
    `raw_doctor` longtext NOT NULL,
    `raw_hospital` longtext NOT NULL,
    `item_name` varchar(30) NOT NULL,
    `recommend_time` datetime(6) NOT NULL,
    `connected` bool NOT NULL
)
;
ALTER TABLE `api_recommend_doctor` ADD CONSTRAINT `person_id_refs_id_36bd197a` FOREIGN KEY (`person_id`) REFERENCES `api_person` (`id`);
ALTER TABLE `api_recommend_doctor` ADD CONSTRAINT `diary_id_refs_id_3510d4ec` FOREIGN KEY (`diary_id`) REFERENCES `api_diary` (`id`);

COMMIT;
