-- Deploy gaia:2019-06-05-add_special_pool to mysql

BEGIN;

CREATE TABLE `api_special_pool` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(80) NOT NULL,
    `home_feed_cover_image` varchar(255) NOT NULL,
    `detail_cover_image` varchar(255) NOT NULL,
    `visual_page_id` integer NOT NULL default 0,
    `project_tag_id` integer NOT NULL default 0,
    `callback_for_ai` bool NOT NULL default 0,
    `is_online` bool NOT NULL default 0,
    `order` integer NOT NULL default 999999,
    `a_position_image` varchar(255) NOT NULL,
    `b_position_image` varchar(255) NOT NULL,
    `c_d_position_image` varchar(255) NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
)
;

CREATE TABLE `api_special_pool_relation_tag` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `special_pool_id` integer NOT NULL default 0,
    `project_tag_id` integer NOT NULL default 0,
    `is_deleted` bool NOT NULL default 0,
    `created_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
)
;

COMMIT;
