-- Deploy gaia:api_2016_07_05_create_table_api_phone_service to mysql

BEGIN;

CREATE TABLE `api_phone_service_record` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `doctor_id` varchar(100),
    `call_phone` varchar(38),
    `dest_phone` varchar(38),
    `call_time` datetime(6),
    `transfer_phone` varchar(10),
    `call_status` integer NOT NULL,
    `audio_url` varchar(120) NOT NULL
)
;
ALTER TABLE `api_phone_service_record` ADD CONSTRAINT `doctor_id_refs_id_8398972b` FOREIGN KEY (`doctor_id`) REFERENCES `api_doctor` (`id`);

COMMIT;
