-- Deploy gaia:api_2015_12_14_add_table_consult_wiki to mysql
-- 添加表 consult_wiki 用于咨询模块热门百科的配置

BEGIN;

CREATE TABLE `api_consult_wiki` (
    `id` INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `wiki_id` INTEGER NOT NULL,
    `icon` VARCHAR (1024) NOT NULL,
    `ordering` INTEGER DEFAULT 0,
    `is_online` TINYINT(1) DEFAULT 1
);

ALTER TABLE `api_consult_wiki` ADD CONSTRAINT `api_consult_wiki_wiki_id_references_api_itemwiki_id` FOREIGN KEY (`wiki_id`) REFERENCES `api_itemwiki` (`id`);

COMMIT;
