-- Deploy gaia:2019_08_23_add_table_ip_device to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `hippo_ipblacklist` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `ip` varchar(255) NOT NULL,
    `pull_black_type` integer NOT NULL,
    `is_delete` bool DEFAULT FALSE,
    `create_at` datetime(6) NOT NULL,
    `update_at` datetime(6) NOT NULL,
    `is_redis` bool DEFAULT FALSE
)
;
CREATE TABLE `hippo_deviceblacklist` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `device_id` varchar(255) NOT NULL,
    `pull_black_type` integer NOT NULL,
    `is_delete` bool DEFAULT FALSE,
    `create_at` datetime(6) NOT NULL,
    `update_at` datetime(6) NOT NULL,
    `is_redis` bool DEFAULT FALSE
)
;

CREATE INDEX `hippo_ipblacklist_gjd2sa31` ON `hippo_ipblacklist` (`ip`);
CREATE INDEX `hippo_ipblacklist_86e5fed8` ON `hippo_ipblacklist` (`create_at`);
CREATE INDEX `hippo_ipblacklist_dsae90d8` ON `hippo_ipblacklist` (`update_at`);

CREATE INDEX `hippo_deviceblacklist_6asd16q8` ON `hippo_deviceblacklist` (`device_id`);
CREATE INDEX `hippo_deviceblacklist_61e9f0d1` ON `hippo_deviceblacklist` (`create_at`);
CREATE INDEX `hippo_deviceblacklist_9165fad8` ON `hippo_deviceblacklist` (`update_at`);

COMMIT;
