-- Deploy gaia:api_2015_12_09_alter_table_api_doctor_related_doctor_tip to mysql

BEGIN;

CREATE TABLE `api_doctor_related_doctor` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `from_doctor_id` varchar(100) NOT NULL,
    `to_doctor_id` varchar(100) NOT NULL,
    UNIQUE (`from_doctor_id`, `to_doctor_id`)
)
;
ALTER TABLE `api_doctor_related_doctor` ADD CONSTRAINT `from_doctor_id_refs_id_c8a7bf4f` FOREIGN KEY (`from_doctor_id`) REFERENCES `api_doctor` (`id`);
ALTER TABLE `api_doctor_related_doctor` ADD CONSTRAINT `to_doctor_id_refs_id_c8a7bf4f` FOREIGN KEY (`to_doctor_id`) REFERENCES `api_doctor` (`id`);

ALTER TABLE `api_doctor` ADD COLUMN `tip` varchar(128) NOT NULL;

COMMIT;
