-- Deploy gaia:2018_11_19_create_model_user to mysql

BEGIN;

CREATE TABLE `api_merchantdevice` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `device_id` integer NOT NULL UNIQUE,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL
)
;
ALTER TABLE `api_merchantdevice` ADD CONSTRAINT `device_id_refs_id_45bbe2e6` FOREIGN KEY (`device_id`) REFERENCES `statistic_device` (`id`);
CREATE TABLE `api_classifyuser` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `user_id` integer NOT NULL,
    `classify` varchar(2) NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    UNIQUE (`user_id`, `classify`)
)
;
ALTER TABLE `api_classifyuser` ADD CONSTRAINT `user_id_refs_id_5b52fe6f` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);

COMMIT;
