-- Deploy gaia:2020-1-2_add_column_tag_type to mysql

BEGIN;

ALTER TABLE api_tag_3_0 ADD COLUMN tag_type SMALLINT default 1;
CREATE TABLE `api_tag_v3_relation` (
        `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
        `child_id` integer NOT NULL,
        `parent_id` integer NOT NULL,
        `create_time` datetime(6) NOT NULL,
        `update_time` datetime(6) NOT NULL,
        `is_online` bool NOT NULL
        );
ALTER TABLE `api_tag_v3_relation` ADD CONSTRAINT `api_tag_v3_relation_parent_id_child_id_7bbc4784_uniq` UNIQUE (`parent_id`, `child_id`);

COMMIT;
