-- Deploy gaia:create_table_for_toprank_2020_02_18 to mysql

BEGIN;

CREATE TABLE `api_toprankbanner` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `rank_type` varchar(64) NOT NULL,
    `city_id` varchar(128) NOT NULL,
    `city_name` varchar(128) NOT NULL,
    `img_src` varchar(200) NOT NULL,
    `is_online` bool NOT NULL,
    `create_at` datetime(6) NOT NULL
) default charset utf8
;


CREATE TABLE `api_toprankmeddle` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `city_id` varchar(128) NOT NULL,
    `city_name` varchar(128) NOT NULL,
    `sort_idx` integer NOT NULL,
    `rank_type` varchar(32) NOT NULL,
    `is_online` bool NOT NULL,
    `target_id` varchar(128) NOT NULL,
    `target_name` varchar(200) NOT NULL,
    `start_time` datetime(6) NOT NULL,
    `end_time` datetime(6) NOT NULL,
    `create_at` datetime(6) NOT NULL
) default charset utf8
;

COMMIT;
