BEGIN;
CREATE TABLE `api_campaignimagelink` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(50) NOT NULL,
    `link_type` varchar(2) NOT NULL,
    `image_layout` varchar(2) NOT NULL,
    `image` varchar(1024) NOT NULL,
    `image1` varchar(1024),
    `topic_id` integer,
    `service_id` integer,
    `diary_id` integer,
    `tag_id` integer,
    `activity_id` integer,
    `special_id` integer,
    `url` varchar(1024),
    `ordering` integer NOT NULL,
    `created_time` datetime(6) NOT NULL,
    `effect_time` datetime(6),
    `end_time` datetime(6),
    `is_online` bool NOT NULL,
    `module_type` integer NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `api_campaignimagelink` ADD CONSTRAINT `diary_id_refs_id_0605ea3a` FOREIGN KEY (`diary_id`) REFERENCES `api_diary` (`id`);
ALTER TABLE `api_campaignimagelink` ADD CONSTRAINT `tag_id_refs_id_02ba5de9` FOREIGN KEY (`tag_id`) REFERENCES `api_tag` (`id`);
ALTER TABLE `api_campaignimagelink` ADD CONSTRAINT `special_id_refs_id_7e471746` FOREIGN KEY (`special_id`) REFERENCES `api_special` (`id`);
ALTER TABLE `api_campaignimagelink` ADD CONSTRAINT `activity_id_refs_id_4f5d8279` FOREIGN KEY (`activity_id`) REFERENCES `api_activity` (`id`);
ALTER TABLE `api_campaignimagelink` ADD CONSTRAINT `topic_id_refs_id_ee64654d` FOREIGN KEY (`topic_id`) REFERENCES `api_problem` (`id`);
ALTER TABLE `api_campaignimagelink` ADD CONSTRAINT `service_id_refs_id_53c50a45` FOREIGN KEY (`service_id`) REFERENCES `api_service` (`id`);

COMMIT;
