-- Deploy mimas-talos:2018_06_07_create_table_bd_diary to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `bd_diary` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `diary_id` integer NOT NULL UNIQUE,
    `is_submit` bool NOT NULL DEFAULT FALSE,
    `create_time` datetime(6) NOT NULL,
    `submit_time` datetime(6) NOT NULL
);
ALTER TABLE `bd_diary` ADD CONSTRAINT `bd_diary_diary_id_d0f255ba_fk_api_diary_id` FOREIGN KEY (`diary_id`) REFERENCES `api_diary` (`id`);


COMMIT;
