-- Deploy mimas-qa:qa_2020_03_02_create_table_relation_tag_v3 to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_answer_tag_v3` (
	`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
	`answer_id` integer NOT NULL,
	`tag_v3_id` integer NOT NULL
);

CREATE TABLE `api_question_tag_v3` (
	`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
	`question_id` integer NOT NULL,
	`tag_v3_id` integer NOT NULL
);


CREATE INDEX `api_answer_tag_v3_fb12e902` ON `api_answer_tag_v3` (`answer_id`);
CREATE INDEX `api_answer_tag_v3_f08f66f7` ON `api_answer_tag_v3` (`tag_v3_id`);


CREATE INDEX `api_question_tag_v3_7aa0f6ee` ON `api_question_tag_v3` (`question_id`);
CREATE INDEX `api_question_tag_v3_f08f66f7` ON `api_question_tag_v3` (`tag_v3_id`);

COMMIT;
