-- Deploy gaia:2020_04_21_upgrade_indic to mysql

BEGIN;

CREATE TABLE `statistic_merchantupgradeindic` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `merchant_doctor_id` varchar(50),
    `merchant_name` varchar(50),
    `pay_order_num` integer,
    `validate_order_num` integer,
    `upgrade_order_num` integer,
    `upgrade_order_amount` double precision,
    `validate_order_rate` double precision,
    `upgrade_order_rate` double precision,
    `single_upgrade_order_amount` double precision NOT NULL,
    `create_date` varchar(255) NOT NULL
)
;
CREATE TABLE `statistic_merchantupgradeindicavg` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `validate_order_rate_avg` double precision,
    `upgrade_order_rate_avg` double precision,
    `single_upgrade_order_amount_avg` double precision NOT NULL,
    `create_date` varchar(255) NOT NULL
)
;

CREATE INDEX `statistic_merchantupgradeindic_5f8193f0` ON `statistic_merchantupgradeindic` (`merchant_doctor_id`);
CREATE INDEX `statistic_merchantupgradeindic_e24d9ee1` ON `statistic_merchantupgradeindic` (`create_date`);
CREATE INDEX `statistic_merchantupgradeindicavg_e24d9ee1` ON `statistic_merchantupgradeindicavg` (`create_date`);

COMMIT;
