-- Deploy gaia:api_2016_06_21_create_table_api_singlerecord to mysql

BEGIN;

CREATE TABLE `api_singlerecord` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `doctor_id` varchar(100) NOT NULL,
    `service_id` integer,
    `single_date` datetime(6) NOT NULL,
    `record_date` datetime(6) NOT NULL,
    `remark` longtext NOT NULL
)
;
ALTER TABLE `api_singlerecord` ADD CONSTRAINT `service_id_refs_id_ce34d31b` FOREIGN KEY (`service_id`) REFERENCES `api_service` (`id`);
ALTER TABLE `api_singlerecord` ADD CONSTRAINT `user_id_refs_id_4dd58695` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);
ALTER TABLE `api_singlerecord` ADD CONSTRAINT `doctor_id_refs_id_db225984` FOREIGN KEY (`doctor_id`) REFERENCES `api_doctor` (`id`);
-- XXX Add DDLs here.

COMMIT;
