-- Deploy gaia:api_20180313_tag_resembles to mysql

BEGIN;

CREATE TABLE `api_tag_resembles` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `from_tag_id` integer NOT NULL,
    `to_tag_id` integer NOT NULL,
    UNIQUE (`from_tag_id`, `to_tag_id`)
)
;
ALTER TABLE `api_tag_resembles` ADD CONSTRAINT `from_tag_id_refs_id_3ab09ea2` FOREIGN KEY (`from_tag_id`) REFERENCES `api_tag` (`id`);
ALTER TABLE `api_tag_resembles` ADD CONSTRAINT `to_tag_id_refs_id_3ab09ea2` FOREIGN KEY (`to_tag_id`) REFERENCES `api_tag` (`id`);
CREATE INDEX `api_tag_resembles_98126f04` ON `api_tag_resembles` (`from_tag_id`);
CREATE INDEX `api_tag_resembles_25edcd61` ON `api_tag_resembles` (`to_tag_id`);

COMMIT;
