-- Deploy gaia:2019-09-25-create_business_kpi_data_and_city_relation_table to mysql

BEGIN;

CREATE TABLE `api_business_kpi_data` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_online` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `is_deleted` bool NOT NULL,
    `advertisement_group` varchar(100) NOT NULL,
    `advertisement_consume_kpi` double precision NOT NULL,
    `usadvertisement_top_up_kpi` double precision NOT NULL,
    `operator` integer NOT NULL,
    `kpi_date` date NOT NULL
)
;
CREATE TABLE `api_business_city_relation` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_online` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `is_deleted` bool NOT NULL,
    `advertisement_name` varchar(100) NOT NULL,
    `city_ids` longtext NOT NULL,
    `operator` integer NOT NULL
)
;

COMMIT;
