-- Deploy gaia:2019_09_25_add_special_polymer_id to mysql

BEGIN;

alter table `api_specialexterior` add column `special_polymer_id` integer NULL ;
alter table `api_special` add column `polymer_backgrond_image` varchar(255) DEFAULT '';
CREATE INDEX `api_specialexterior_e312b628` ON `api_specialexterior` (`special_polymer_id`);

CREATE TABLE `api_seckillpolymer` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `title` varchar(255) NOT NULL,
    `image` varchar(255) NOT NULL,
    `tool_bar_json` longtext NOT NULL
)
;
CREATE TABLE `api_seckillrelatedspecial` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `seckillpolymer_id` integer NOT NULL,
    `special_id` integer NOT NULL
)
;

ALTER TABLE `api_seckillrelatedspecial` ADD CONSTRAINT `seckillpolymer_id_refs_id_927f28e8` FOREIGN KEY (`seckillpolymer_id`) REFERENCES `api_seckillpolymer` (`id`);
ALTER TABLE `api_seckillrelatedspecial` ADD CONSTRAINT `special_id_refs_id_a634005f` FOREIGN KEY (`special_id`) REFERENCES `api_special` (`id`);
CREATE INDEX `api_seckillrelatedspecial_f2b38ea0` ON `api_seckillrelatedspecial` (`seckillpolymer_id`);
CREATE INDEX `api_seckillrelatedspecial_57902095` ON `api_seckillrelatedspecial` (`special_id`);
COMMIT;
