-- Deploy gaia:api_2016_01_04_create_table_api_diaryvote to mysql

BEGIN;

CREATE TABLE `api_diaryvote` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `diary_id` integer NOT NULL,
    `vote_time` datetime(6) NOT NULL,
    `unread` bool NOT NULL,
    UNIQUE (`user_id`, `diary_id`)
);

COMMIT;
