-- 10300 to 10400

-- main
-- nada na main
-- domain

CREATE TABLE IF NOT EXISTS AppCustomPages (
    id tinyint(3) unsigned NOT NULL auto_increment,
    title varchar(30) NOT NULL DEFAULT '' COLLATE utf8_unicode_ci,
    icon varchar(40) NOT NULL DEFAULT '' COLLATE utf8_unicode_ci,
    json text NOT NULL DEFAULT '' COLLATE utf8_unicode_ci,
    PRIMARY KEY (id)
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS  Timeline (
    id int(11) NOT NULL auto_increment,
    item_type varchar(20) NOT NULL DEFAULT '' COLLATE utf8_unicode_ci,
    item_id int(11) NOT NULL DEFAULT 0 COMMENT '',
    `action` set('new','edit') NOT NULL DEFAULT 'new' COLLATE utf8_unicode_ci,
    datetime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    new char(1) NOT NULL DEFAULT 'y' COLLATE utf8_unicode_ci,
    PRIMARY KEY (id),
    INDEX item_type (item_type)
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


ALTER TABLE ArticleLevel ADD featured char(1) NOT NULL DEFAULT 'y' COMMENT '' COLLATE utf8_unicode_ci AFTER content;
ALTER TABLE ClassifiedLevel ADD featured char(1) NOT NULL DEFAULT '' COMMENT '' COLLATE utf8_unicode_ci AFTER popular;
ALTER TABLE Event ADD video_url varchar(255) NOT NULL DEFAULT '' COMMENT '' COLLATE utf8_unicode_ci AFTER video_snippet;
ALTER TABLE EventLevel ADD featured char(1) NOT NULL DEFAULT '' COMMENT '' COLLATE utf8_unicode_ci AFTER popular;
ALTER TABLE Listing ADD video_url varchar(255) NOT NULL DEFAULT '' COMMENT '' COLLATE utf8_unicode_ci AFTER video_snippet;
ALTER TABLE ListingLevel ADD featured char(1) NOT NULL DEFAULT '' COMMENT '' COLLATE utf8_unicode_ci AFTER popular;


UPDATE ArticleLevel 	SET featured = detail;
UPDATE ClassifiedLevel 	SET featured = detail;
UPDATE EventLevel 	SET featured = detail;
UPDATE ListingLevel 	SET featured = detail;

