-- Deploy gaia:api_2017_02_09_create_table_seo_digest to mysql

BEGIN;

CREATE TABLE `api_seodigest` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `title` varchar(128) NOT NULL,
    `keywords` longtext,
    `description` longtext,
    `seo_category_id` integer,
    `editor` varchar(16),
    `content` longtext,
    `create_time` datetime(6) NOT NULL,
    `online_time` datetime(6),
    `is_online` bool NOT NULL
);

ALTER TABLE `api_seodigest` ADD CONSTRAINT `seo_category_id_refs_id_6db13b75` FOREIGN KEY (`seo_category_id`) REFERENCES `api_seocategory` (`id`);
CREATE INDEX `api_seoarticle_766b0d68` ON `api_seodigest` (`seo_category_id`);

COMMIT;
