-- Deploy gaia:2019-12-04-add_polymer_table_about_tag to mysql

BEGIN;

CREATE TABLE `api_polymer_ai_master_tag` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_online` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `tag_id` integer NOT NULL,
    `polymer_id` integer NOT NULL,
    UNIQUE (`tag_id`, `polymer_id`)
)
;
CREATE TABLE `api_polymer_ai_slave_tag` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_online` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `tag_id` integer NOT NULL,
    `polymer_id` integer NOT NULL,
    UNIQUE (`tag_id`, `polymer_id`)
)
;
CREATE TABLE `api_polymer_surgery` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `is_surgery` bool NOT NULL,
    `create_time` datetime(6) NOT NULL,
    `update_time` datetime(6) NOT NULL,
    `polymer_id` integer NOT NULL UNIQUE
)
;

COMMIT;
