-- Deploy gaia:2019_10_28_add_user_scan_record to mysql

BEGIN;

CREATE TABLE `api_scan_record` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `device_id` varchar(128) NOT NULL,
    `scan_type` integer NOT NULL,
    `data` longtext NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `updated_time` datetime(6) NOT NULL
)
;
CREATE INDEX `api_scan_record_1ffdedc6` ON `api_scan_record` (`user_id`);
CREATE INDEX `api_scan_record_6d993ecb` ON `api_scan_record` (`device_id`);

COMMIT;
