-- Deploy gaia:2020_03_06_create_table_merchant_level_record to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `hippo_merchantlevelrecord` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `merchant_id` bigint NOT NULL,
    `merchant_level` integer NOT NULL,
    `merchant_score` double precision NOT NULL,
    `verify_gmv_amount` double precision NOT NULL,
    `advertise_consume_amount` double precision NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `verify_pv_amount` double precision NOT NULL,
    `refund_proportion` double precision NOT NULL
)
;
ALTER TABLE `hippo_merchantlevelrecord` ADD CONSTRAINT `merchant_id_refs_id_a31ddaa8` FOREIGN KEY (`merchant_id`) REFERENCES `hippo_merchant` (`id`);
ALTER TABLE `hippo_merchant` ADD COLUMN `verify_gmv_amount` float(8, 2);
ALTER TABLE `hippo_merchant` ADD COLUMN `advertise_consume_amount` float(8, 2);
ALTER TABLE `hippo_merchant` ADD COLUMN `verify_pv_amount` float(6, 2);
ALTER TABLE `hippo_merchant` ADD COLUMN `refund_proportion` float(6, 3);
COMMIT;
