-- Deploy gaia:api_2017_08_01_create_table_api_special_button_city_tag to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_specialseckillbutton_cities` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `specialseckillbutton_id` integer NOT NULL,
    `city_id` varchar(40) NOT NULL
)
;
ALTER TABLE `api_specialseckillbutton_cities` ADD CONSTRAINT `specialseckillbutton_id_refs_id_2fd15cae` FOREIGN KEY (`specialseckillbutton_id`) REFERENCES `api_specialseckillbutton` (`id`);
ALTER TABLE `api_specialseckillbutton_cities` ADD CONSTRAINT `city_id_refs_id_b376980e` FOREIGN KEY (`city_id`) REFERENCES `api_city` (`id`);

CREATE TABLE `api_specialseckillbutton_tags` (
  `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
  `specialseckillbutton_id` integer NOT NULL,
  `tag_id` integer NOT NULL
)
;
ALTER TABLE `api_specialseckillbutton_tags` ADD CONSTRAINT `specialseckillbutton_id_refs_id_61215cae` FOREIGN KEY (`specialseckillbutton_id`) REFERENCES `api_specialseckillbutton` (`id`);
ALTER TABLE `api_specialseckillbutton_tags` ADD CONSTRAINT `tag_id_refs_id_5659cca2` FOREIGN KEY (`tag_id`) REFERENCES `api_tag` (`id`);

COMMIT;
