Skip to content

Commit

Permalink
Add update sql file for tags tables
Browse files Browse the repository at this point in the history
  • Loading branch information
dextercowley committed Mar 6, 2013
1 parent fca6f36 commit 26791c3
Showing 1 changed file with 144 additions and 0 deletions.
144 changes: 144 additions & 0 deletions administrator/components/com_admin/sql/updates/mysql/3.1.0.sql
@@ -0,0 +1,144 @@
CREATE TABLE IF NOT EXISTS `#__tags` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`lft` int(11) NOT NULL DEFAULT '0',
`rgt` int(11) NOT NULL DEFAULT '0',
`level` int(10) unsigned NOT NULL DEFAULT '0',
`path` varchar(255) NOT NULL DEFAULT '',
`title` varchar(255) NOT NULL,
`alias` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`note` varchar(255) NOT NULL DEFAULT '',
`description` mediumtext NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) unsigned NOT NULL DEFAULT '0',
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`access` int(10) unsigned NOT NULL DEFAULT '0',
`params` text NOT NULL,
`metadesc` varchar(1024) NOT NULL COMMENT 'The meta description for the page.',
`metakey` varchar(1024) NOT NULL COMMENT 'The meta keywords for the page.',
`metadata` varchar(2048) NOT NULL COMMENT 'JSON encoded metadata properties.',
`created_user_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_by_alias` varchar(255) NOT NULL DEFAULT '',
`modified_user_id` int(10) unsigned NOT NULL DEFAULT '0',
`modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`images` text NOT NULL,
`urls` text NOT NULL,
`hits` int(10) unsigned NOT NULL DEFAULT '0',
`language` char(7) NOT NULL,
`version` int(10) unsigned NOT NULL DEFAULT '1',
`publish_up` datetime NOT NULL default '0000-00-00 00:00:00',
`publish_down` datetime NOT NULL default '0000-00-00 00:00:00',

PRIMARY KEY (`id`),
KEY `tag_idx` (`published`,`access`),
KEY `idx_access` (`access`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_path` (`path`),
KEY `idx_left_right` (`lft`,`rgt`),
KEY `idx_alias` (`alias`),
KEY `idx_language` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `#__tags`
--

INSERT INTO `#__tags` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `note`, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `metadesc`, `metakey`, `metadata`, `created_user_id`, `created_time`,`created_by_alias`, `modified_user_id`, `modified_time`, `images`, `urls`, `hits`, `language`, `version`)
VALUES (1, 0, 0, 1, 0, '', 'ROOT', 'root', '', '', 1, 0, '0000-00-00 00:00:00', 1, '{}', '', '', '', '', '2011-01-01 00:00:01','', 0, '0000-00-00 00:00:00', '', '', 0, '*', 1);


--
-- Table structure for table `#__content_types`
--

CREATE TABLE IF NOT EXISTS `#__content_types` (
`type_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type_title` varchar(255) NOT NULL DEFAULT '',
`type_alias` varchar(255) NOT NULL DEFAULT '',
`table` varchar(255) NOT NULL DEFAULT '',
`rules` text NOT NULL,
`field_mappings` text NOT NULL,
`router` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`type_id`),
KEY `idx_alias` (`type_alias`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `#__content_types`
--

INSERT INTO `#__content_types` (`type_id`, `type_title`, `type_alias`, `table`, `rules`, `field_mappings`,`router`) VALUES
(0, 'Article', 'com_content.article', '#__content', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"introtext", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"attribs", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"urls", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"asset_id"}], "special": [{"fulltext":"fulltext"}]}','ContentHelperRoute::getArticleRoute'),
(0, 'Weblink', 'com_weblinks.weblink', '#__weblinks', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"description", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"urls", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}], "special": []}','WeblinksHelperRoute::getWeblinkRoute'),
(0, 'Contact', 'com_contact.contact', '#__contact_details', '', '{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"published","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"address", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"website", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}], "special": [{"con_position":"con_position","suburb":"suburb","state":"state","country":"country","postcode":"postcode","telephone":"telephone","fax":"fax","misc":"misc","email_to":"email_to","default_con":"default_con","user_id":"user_id","mobile":"mobile","sortname1":"sortname1","sortname2":"sortname2","sortname3":"sortname3"}]}','ContactHelperRoute::getContactRoute'),
(0, 'Newsfeed', 'com_newsfeeds.newsfeed', '#__newsfeeds', '', '{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"published","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"description", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"link", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}], "special": [{"numarticles":"numarticles","cache_time":"cache_time","rtl":"rtl"}]}','NewsfeedsHelperRoute::getNewsfeedRoute'),
(0, 'User', 'com_users.user', '#__users', '', '{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"null","core_alias":"username","core_created_time":"registerdate","core_modified_time":"lastvisitDate","core_body":"null", "core_hits":"null","core_publish_up":"null","core_publish_down":"null","access":"null", "core_params":"params", "core_featured":"null", "core_metadata":"null", "core_language":"null", "core_images":"null", "core_urls":"null", "core_version":"null", "core_ordering":"null", "core_metakey":"null", "core_metadesc":"null", "core_catid":"null", "core_xreference":"null", "asset_id":"null"}], "special": [{}]}','UsersHelperRoute::getUserRoute'),
(0, 'Article Category', 'com_content.category', '#__categories', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}','ContentHelperRoute::getCategoryRoute'),
(0, 'Contact Category', 'com_contact.category', '#__categories', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}','ContactHelperRoute::getCategoryRoute'),
(0, 'Newsfeeds Category', 'com_newsfeeds.category', '#__categories', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}','NewsfeedsHelperRoute::getCategoryRoute'),
(0, 'Weblinks Category', 'com_weblinks.category', '#__categories', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}','WeblinksHelperRoute::getCategoryRoute'),
(0, 'Tag', 'com_tags.tag', '#__tags', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"urls", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"null", "core_xreference":"null", "asset_id":"null"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path"}]}','TagsHelperRoute::getTagRoute');

CREATE TABLE IF NOT EXISTS `#__contentitem_tag_map` (
`type_alias` varchar(255) NOT NULL DEFAULT '',
`core_content_id` int(10) unsigned NOT NULL COMMENT 'PK from the core content table',
`content_item_id` int(11) NOT NULL COMMENT 'PK from the content type table',
`tag_id` int(10) unsigned NOT NULL COMMENT 'PK from the tag table',
`tag_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Date of most recent save for this tag-item',
CONSTRAINT uc_ItemnameTagid UNIQUE (`type_alias`, `content_item_id`, `tag_id`),
KEY idx_tag_name (`tag_id`, `type_alias`),
KEY idx_date_id (`tag_date`, `tag_id`),
KEY idx_tag (`tag_id`),
KEY idx_core_content_id (`core_content_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Maps items from content tables to tags';

CREATE TABLE IF NOT EXISTS `#__core_content` (
`core_content_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`core_type_alias` varchar(255) NOT NULL DEFAULT '' COMMENT 'FK to the content types table',
`core_title` varchar(255) NOT NULL,
`core_alias` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`core_body` mediumtext NOT NULL,
`core_state` tinyint(1) NOT NULL DEFAULT '0',
`core_checked_out_time` varchar(255) NOT NULL DEFAULT '',
`core_checked_out_user_id` int(10) unsigned NOT NULL DEFAULT '0',
`core_access` int(10) unsigned NOT NULL DEFAULT '0',
`core_params` text NOT NULL,
`core_featured` tinyint(4) unsigned NOT NULL DEFAULT '0',
`core_metadata` varchar(2048) NOT NULL COMMENT 'JSON encoded metadata properties.',
`core_created_user_id` int(10) unsigned NOT NULL DEFAULT '0',
`core_created_by_alias` varchar(255) NOT NULL DEFAULT '',
`core_created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`core_modified_user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Most recent user that modified',
`core_modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`core_language` char(7) NOT NULL,
`core_publish_up` datetime NOT NULL,
`core_publish_down` datetime NOT NULL,
`core_content_item_id` int(10) unsigned COMMENT 'ID from the individual type table',
`asset_id` int(10) unsigned COMMENT 'FK to the #__assets table.',
`core_images` text NOT NULL,
`core_urls` text NOT NULL,
`core_hits` int(10) unsigned NOT NULL DEFAULT '0',
`core_version` int(10) unsigned NOT NULL DEFAULT '1',
`core_ordering` int(11) NOT NULL DEFAULT '0',
`core_metakey` text NOT NULL,
`core_metadesc` text NOT NULL,
`core_catid` int(10) unsigned NOT NULL DEFAULT '0',
`core_xreference` varchar(50) NOT NULL COMMENT 'A reference to enable linkages to external data sets.',
`core_type_id` int(10) unsigned,
PRIMARY KEY (`core_content_id`),
UNIQUE KEY `idx_type_alias_item_id` (`core_type_alias`,`core_content_item_id`),
KEY `tag_idx` (`core_state`,`core_access`),
KEY `idx_access` (`core_access`),
KEY `idx_alias` (`core_alias`),
KEY `idx_language` (`core_language`),
KEY `idx_title` (`core_title`),
KEY `idx_modified_time` (`core_modified_time`),
KEY `idx_created_time` (`core_created_time`),
KEY `idx_content_type` (`core_type_alias`),
KEY `idx_core_modified_user_id` (`core_modified_user_id`),
KEY `idx_core_checked_out_user_id` (`core_checked_out_user_id`),
KEY `idx_core_created_user_id` (`core_created_user_id`),
KEY `idx_core_type_id` (`core_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Contains core content data in name spaced fields';
SET foreign_key_checks = 1;

0 comments on commit 26791c3

Please sign in to comment.