-- Deploy gaia:group_2020_05_22_alter_group_topic to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_top_content` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `theme` varchar(32) NOT NULL,
    `title` varchar(128) NOT NULL,
    `content_type` varchar(3) NOT NULL,
    `content_id` integer NOT NULL DEFAULT 0,
    `related_type` integer NOT NULL DEFAULT 1,
    `related_id` integer NOT NULL DEFAULT 0,
    `is_online` bool NOT NULL DEFAULT 1,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
)DEFAULT CHARSET=utf8mb4;

ALTER TABLE `api_group` ADD COLUMN `sm_head_image` varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `api_group` ADD COLUMN `group_type` integer NOT NULL DEFAULT 1;
ALTER TABLE `api_group` ADD COLUMN `is_single_feed` TINYINT(1) NOT NULL DEFAULT 0;

ALTER TABLE `api_group_topic` ADD COLUMN `sm_head_image` varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `api_group_topic` ADD COLUMN `group_topic_type` integer NOT NULL DEFAULT 1;
ALTER TABLE `api_group_topic` ADD COLUMN `is_single_feed` TINYINT(1) NOT NULL DEFAULT 0;

COMMIT;
