-- Deploy gaia:2017_08_14_add_column_device_idfa to mysql

BEGIN;

CREATE TABLE `statistic_deviceidfa` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `device_id` varchar(100) NOT NULL,
    `platform` varchar(20) NOT NULL,
    `idfv` varchar(100) NOT NULL,
    `idfa` varchar(100) NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `last_activity` datetime(6) NOT NULL,
    `risk_result` varchar(2) NOT NULL,
    `risk_score` integer NOT NULL,
    `risk_check` bool NOT NULL,
    UNIQUE (`device_id`, `platform`, `idfa`)
);

COMMIT;
