-- Deploy gaia:api_2016_03_25_add_table_votepk to mysql

BEGIN;

CREATE TABLE `api_votepk` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `topic_id` int(11) NOT NULL,
    `person_id` char(32) NOT NULL,
    `vote_date` datetime(6) DEFAULT NULL,
    `vote_doctor_id` varchar(100) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY user_doctor_date (topic_id, person_id, vote_date)
);

COMMIT;
