-- Deploy gaia:2019-06-19-scan-face-facial to mysql

BEGIN;

CREATE TABLE `api_facial` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `facial_type` smallint NOT NULL,
    `classification` varchar(30) NOT NULL,
    `desc` varchar(1024) NOT NULL,
    `is_online` bool NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `updated_time` datetime(6) NOT NULL
);

CREATE TABLE `api_facial_combination` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `contour` varchar(30) NOT NULL DEFAULT 'unknown',
    `chin` varchar(30) NOT NULL DEFAULT 'unknown',
    `eyebrow` varchar(30) NOT NULL DEFAULT 'unknown',
    `eye` varchar(30) NOT NULL DEFAULT 'unknown',
    `nose` varchar(30) NOT NULL DEFAULT 'unknown',
    `lip` varchar(30) NOT NULL DEFAULT 'unknown',
    `title` varchar(50) NOT NULL,
    `desc` varchar(1024) NOT NULL,
    `is_online` bool NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `updated_time` datetime(6) NOT NULL
);

COMMIT;
