-- Deploy mimas-qa:qa_2019_12_09_create_table_api_answer_tag to mysql

BEGIN;

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

ALTER TABLE `api_answer_tag` ADD CONSTRAINT `api_answer_tag_answer_id_9af27543_fk_api_answer_id` FOREIGN KEY (`answer_id`) REFERENCES `api_answer` (`id`);
CREATE INDEX `api_answer_tag_76f094bc` ON `api_answer_tag` (`tag_id`);

COMMIT;
