-- Deploy gaia:api_2017_02_28_create_api_tag_relation_ad to mysql

BEGIN;


CREATE TABLE `api_tag_relation_ad` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `advertisemanagement_id` integer DEFAULT NULL,
    `tag_id` integer DEFAULT NULL
);
ALTER TABLE `api_tag_relation_ad` ADD CONSTRAINT `advertisemanagement_id_refs_id` FOREIGN KEY (`advertisemanagement_id`) REFERENCES `api_advertisemanagement` (`id`);
ALTER TABLE `api_tag_relation_ad` ADD CONSTRAINT `tag_id_refs_id` FOREIGN KEY (`tag_id`) REFERENCES `api_tag` (`id`);

COMMIT;
