-- Deploy gaia:api_2015_12_24_create_table_api_privatemessagepush to mysql

BEGIN;

CREATE TABLE `api_privatemessagepush` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `content` varchar(1024) NOT NULL,
    `service_id` integer,
    `doctor_id` varchar(100),
    `hospital_id` varchar(100),
    `order_status` varchar(100),
    `send_time` datetime NOT NULL,
    `status` integer NOT NULL
);

ALTER TABLE `api_privatemessagepush` ADD CONSTRAINT `doctor_id_refs_id_c8eff3b3` FOREIGN KEY (`doctor_id`) REFERENCES `api_doctor` (`id`);
ALTER TABLE `api_privatemessagepush` ADD CONSTRAINT `hospital_id_refs_id_80594f20` FOREIGN KEY (`hospital_id`) REFERENCES `api_hospital` (`id`);
ALTER TABLE `api_privatemessagepush` ADD CONSTRAINT `service_id_refs_id_e8c533d9` FOREIGN KEY (`service_id`) REFERENCES `api_service` (`id`);

COMMIT;
