-- Deploy gaia:2019_04_22_special_related_tag to mysql

BEGIN;

CREATE TABLE `api_specialrelatedtag` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `special_id` integer NOT NULL,
    `tag_id` integer NOT NULL,
    `floor_id` integer NOT NULL,
    UNIQUE (`special_id`, `tag_id`, `floor_id`)
)
;
ALTER TABLE `api_specialrelatedtag` ADD CONSTRAINT `special_id_refs_id_9fd9a4d0` FOREIGN KEY (`special_id`) REFERENCES `api_special` (`id`);
ALTER TABLE `api_specialrelatedtag` ADD CONSTRAINT `tag_id_refs_id_f38a9b86` FOREIGN KEY (`tag_id`) REFERENCES `api_tag` (`id`);
CREATE INDEX `api_specialrelatedtag_57902095` ON `api_specialrelatedtag` (`special_id`);
CREATE INDEX `api_specialrelatedtag_5659cca2` ON `api_specialrelatedtag` (`tag_id`);

COMMIT;
