-- Deploy gaia:2018_08_16_create_table_api_cityscale_nearby_city to mysql

BEGIN;

CREATE TABLE `api_cityscale_nearby_city` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `cityscale_id` integer NOT NULL,
    `nearby_city_id` varchar(40) NOT NULL
)
;
ALTER TABLE `api_cityscale_nearby_city` ADD CONSTRAINT `cityscale_id_refs_id_fccb3b7f` FOREIGN KEY (`cityscale_id`) REFERENCES `api_cityscale` (`id`);
ALTER TABLE `api_cityscale_nearby_city` ADD CONSTRAINT `nearby_city_id_refs_id_c9457707` FOREIGN KEY (`nearby_city_id`) REFERENCES `api_city` (`id`);

CREATE INDEX `api_cityscale_nearby_city_48926308` ON `api_cityscale_nearby_city` (`cityscale_id`);
CREATE INDEX `api_cityscale_nearby_city_6ab8a25f` ON `api_cityscale_nearby_city` (`nearby_city_id`);

COMMIT;
