-- Deploy gaia:api_2016_08_23_add_table_draft_drafttag_alter_topicimage to mysql

BEGIN;

CREATE TABLE `api_draft` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `update_time` datetime NOT NULL,
    `is_show` BOOLEAN NOT NULL,
    `diary_id` INT(11),
    `content` longtext NOT NULL,
    `tags` VARCHAR(64),
    `images` longtext,
    `zone_tag` INT(11),
    `cover` VARCHAR(100),
    `person_id` VARCHAR(32),
    PRIMARY KEY (`id`),
    constraint `api_draft_ref_api_diary` foreign key (`diary_id`) references `api_diary` (`id`),
    constraint `api_draft_ref_api_person` foreign key (`person_id`) references `api_person` (`id`)
);

COMMIT;

