-- SHOW GRANTS FOR 'gerd'@'localhost';
-- CREATE USER 'gerd'@'localhost';
-- SET PASSWORD FOR 'gerd'@'localhost' = password("gerd123");
-- CREATE DATABASE `wombat` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
-- GRANT ALL PRIVILEGES ON `wombat`.* TO `gerd`@`localhost`;
-- FLUSH PRIVILEGES;
-- USE `wombat`;

-- views
CREATE TABLE `wbpageview` (
     uid INT(11) NOT NULL DEFAULT 0
     , trackid CHAR(32) NOT NULL DEFAULT ''
     , addr VARCHAR(32) NOT NULL DEFAULT ''
     , namespace enum('site', 'ajax_content', 'ajax_call', 'ajax_xinhadialog', 'ajax_wxmldialog', 'pixel') NOT NULL DEFAULT 'site'
     , counter int(11) NOT NULL DEFAULT 0
     , elapsedstart int(11) NOT NULL DEFAULT 0
     , elapsedlast int(11) NOT NULL DEFAULT 0
     , path VARCHAR(256) NOT NULL DEFAULT ''
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , hint enum('default','ignore','attack', 'spider') NOT NULL default 'default'
     , KEY uidx (uid)
     , KEY (trackid)
     , KEY pathidx (path)
     , KEY createdidx (created)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='List if page views';

-- views
CREATE TABLE `wbsessionview` (
     uid INT(11) NOT NULL DEFAULT 0
     , trackid CHAR(32) NOT NULL DEFAULT ''
     , addr VARCHAR(32) NOT NULL DEFAULT ''
     , referer VARCHAR(256) NOT NULL DEFAULT ''
     , useragent VARCHAR(256) NOT NULL DEFAULT ''
     , acceptlang VARCHAR(256) NOT NULL DEFAULT ''
     , preferedlang CHAR(6) NOT NULL DEFAULT ''
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , browser VARCHAR(256) NOT NULL DEFAULT ''
     , platform VARCHAR(256) NOT NULL DEFAULT ''
     , majorversion INT(11) NOT NULL DEFAULT 0
     , minorversion INT(11) NOT NULL DEFAULT 0
     , hint enum('default','ignore','attack', 'spider') NOT NULL default 'default'
     , KEY uidx (uid)
     , KEY (trackid)
     , KEY createdidx (created)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='List if session views';

DROP TABLE `wbgenericview`;
CREATE TABLE `wbgenericview` (
  `trackid` char(32) NOT NULL DEFAULT '',
  `uid` int(11) NOT NULL DEFAULT '0',
  `namespace`char(32) DEFAULT NULL,
  `counter` int(11) NOT NULL DEFAULT '0',
  `path` varchar(256) NOT NULL DEFAULT '',
  `created` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
  KEY `uidx` (`uid`),
  KEY `pathidx` (`namespace`, `path`),
  KEY `created` (`created`),
  KEY `trackid` (`trackid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='List of generic views';

CREATE TABLE `wbvfsfileview` (
  vfsfid int(11) NOT NULL
 , uid varchar(255) NOT NULL
 , trackid CHAR(32) NOT NULL DEFAULT ''
 , addr VARCHAR(32) NOT NULL DEFAULT ''
 , created datetime NOT NULL default '0000-00-00 00:00:00'
 , hint enum('default','ignore','attack', 'spider') NOT NULL default 'default'
 , KEY (vfsfid)
 , KEY ( uid )
 , KEY ( trackid )
 , KEY ( created )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='media file views';

-- foward tracking
CREATE TABLE `wbforwardtracking` (
  `trackid` char(32) NOT NULL DEFAULT '',
  `urlid` int(11) NOT NULL DEFAULT 0,
  `created` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
  KEY (`trackid`),
  KEY (`urlid`),
  KEY (`created`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Foward tracking';

-- Link tracking
CREATE TABLE `wblinktracking` (
     trackid CHAR(32) NOT NULL DEFAULT ''
     , linkid int(11) NOT NULL DEFAULT 0
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , KEY (trackid)
     , KEY (linkid)
     , KEY createdidx (created)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Link tracking';

CREATE TABLE `wbtracklink` (
     linkid int(11) NOT NULL auto_increment
     , urlid int(11) NOT NULL DEFAULT 0
     , title varchar(255) NOT NULL DEFAULT ''
     , blurb text NOT NULL DEFAULT ''
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , PRIMARY KEY (linkid)
     , KEY (urlid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Link tracking URLs and info';

-- event queue
CREATE TABLE `wbeventqueue` (
    eid INT(11) NOT NULL AUTO_INCREMENT
     , namespace VARCHAR(256) NOT NULL DEFAULT ''
     , action VARCHAR(256) NOT NULL DEFAULT ''
     , name VARCHAR(200) NOT NULL DEFAULT ''
     , message VARCHAR(255) NOT NULL DEFAULT ''
     , data BLOB NOT NULL DEFAULT ''
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , failed TINYINT(1) NOT NULL DEFAULT 0
     , PRIMARY KEY eidix (eid)
     , KEY namespaceidx (namespace)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='event queue for application level events';

-- general purpose obscure codes
CREATE TABLE `wbobscurecode` (
     namespace VARCHAR(200) NOT NULL
     , xid VARCHAR(125) NOT NULL
     , code VARCHAR(255) NOT NULL DEFAULT ''
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , KEY namespaceidx (namespace, xid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='multipurpose obscure codes';

-- Multi purpose counter
CREATE TABLE `wbcounter` (
     namespace CHAR(32) NOT NULL DEFAULT ""
     , counter INT(11) UNSIGNED NOT NULL DEFAULT 0
     , changed DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , PRIMARY KEY namespace (namespace)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='multi purpose counters';

-- User management
CREATE TABLE `wbuser` (
       uid INT(11) NOT NULL AUTO_INCREMENT
     , nickname VARCHAR(255) NOT NULL
     , password CHAR(32)
     , emaillocal VARCHAR(200) NOT NULL
     , emaildomain VARCHAR(125) NOT NULL
     , approved TINYINT NOT NULL DEFAULT 0
     , enabled TINYINT NOT NULL DEFAULT 0
     , deleted TINYINT NOT NULL DEFAULT 0
     , forename VARCHAR(255) NOT NULL DEFAULT ''
     , surname VARCHAR(255) NOT NULL DEFAULT ''
     , lang CHAR(5) NOT NULL DEFAULT 'C'
     , country CHAR(2) NOT NULL DEFAULT 'C'
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , changed DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , lastlogin DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , PRIMARY KEY (uid)
     , KEY email (emaillocal, emaildomain)
     , KEY (nickname)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='users';

INSERT INTO `wbuser` VALUES
(1,'webmaster','xxx','webmaster','example.com',1,0,0,'CMS','Webmaster','C','C','1970-07-15 00:09:24','2009-07-15 00:09:24','1970-01-01 00:00:00'),
(2,'gerd','xxx','gerd','schaufelberger.de',1,0,0,'gERD','Schaufelberger','C','C','1975-08-23 20:45:24','1975-08-23 20:45:24','1970-01-01 00:00:00');

CREATE TABLE `wbgroup` (
  `gid` int(11) AUTO_INCREMENT,
  `groupname` varchar(255) NOT NULL,
  `grouptitle` varchar(255) NOT NULL,
  PRIMARY KEY  (`gid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='named user groups';

INSERT INTO wbgroup (gid,groupname, grouptitle) VALUES
(1, "admin", "Adminiatrator"),
(2, "blogeditor", "Blog Author"),
(3, "vfs", "Media File Manager"),
(4, "guestbookeditor", "Guestbook Manager"),
(5, "vfsgallery", "Media File Gallery Maintainer"),
(6, "contenteditor", "Author"),
(7, "shopuser", "Shop Customer"),
(8, "shopagent", "Shop Agent"),
(9, "shopedior", "Shop Maintainer"),
(10, "shopadmin", "Shop Adminiatrator"),
(11, "its-staff", "Incident Ticket Staff"),
(12, "its-master", "Incident Ticket Master"),
(13, "nls-translator", "Translator"),
(14, "its-user", "Incident Ticket Staff");

CREATE TABLE `wbusergroup` (
  `gid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  KEY `nickname` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='relation of users in group';

INSERT INTO wbusergroup (uid,gid) VALUES
(1, 1),
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(1, 6),
(1, 7),
(1, 8),
(1, 9),
(1, 10);

-- CMS
CREATE TABLE `wbxmlarticle` (
  `cs` char(32) NOT NULL ,
  `status` enum('public', 'draft') NOT NULL default 'public',
  `revision` int(11) NOT NULL default '0',
  `uid` int(11) NOT NULL default '0',
  `created` datetime default NULL,
  `body` blob NOT NULL,
  KEY  (`cs`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Wombat XML Articles';

CREATE TABLE `wbxmlarticletranslation` (
  `cs` char(32) NOT NULL,
  `lang` char(5) NOT NULL,
  `revision` int(11) NOT NULL default '0',
  `uid` int(11) NOT NULL default '0',
  `created` datetime default NULL,
  `body` blob NOT NULL,
  KEY  (`cs`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Wombat XML Article translations';



/*
CREATE TABLE `wbskin` (
  `uid` int(11) NOT NULL,
  `car` varchar(255) NOT NULL default 'maypor',
  `color` varchar(255) NOT NULL default 'black',
  PRIMARY KEY  (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='user skins';
*/

-- GUESTBOOK
CREATE TABLE `wbguestbook` (
  `guestbookid` int(10) NOT NULL auto_increment,
  `uid` int(10) NOT NULL default '0',
  `title` varchar(200) default NULL,
  `created` datetime default NULL,
  `changed` datetime NOT NULL default '0000-00-00 00:00:00',
  `body` text NOT NULL,
  `deleted` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`guestbookid`),
  KEY `created` (`created`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Guest Book Articles';


-- BLOG
CREATE TABLE `wbblog` (
  `blogid` int(10) NOT NULL auto_increment,
  `catid` int(11) NOT NULL,
  `uid` int(10) NOT NULL default '0',
  `title` varchar(200) default NULL,
  `created` datetime default NULL,
  `changed` datetime NOT NULL default '0000-00-00 00:00:00',
  `body` text NOT NULL,
  `published` tinyint(1) NOT NULL default '1',
  `deleted` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`blogid`),
  KEY `created` (`created`),
  KEY `catid` (`catid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Blog Articles';

CREATE TABLE `wbblogcategory` (
  `catid` int(11) NOT NULL auto_increment,
  `title` varchar(250) NOT NULL,
  `brief` text NOT NULL,
  `created` datetime NOT NULL,
  `changed` datetime NOT NULL,
  `owner` varchar(250) NOT NULL default '*',
  `other` set('list','publish','edit') NOT NULL,
  `moderated` tinyint(1) NOT NULL default '0',
  `commentable` enum('nobody','user','admin','anonymous') NOT NULL,
  `uid` int(11) NOT NULL,
  `deleted` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`catid`),
  KEY `title` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Blog Categories';

/**
 * blog comment table is deprecated in favour of wbcomment
 */
CREATE TABLE `wbblogcomment` (
  `blogcid` int(11) NOT NULL auto_increment,
  `blog` varchar(100) NOT NULL,
  `blogid` int(11) NOT NULL,
  `uid` int(11) default NULL,
  `new` tinyint(1) NOT NULL default '1',
  `approved` tinyint(1) NOT NULL default '0',
  `created` datetime NOT NULL,
  `changed` datetime default NULL,
  `commentbody` blob NOT NULL,
  `deleted` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`blogcid`),
  KEY `blog` (`blog`),
  KEY `blogid` (`blogid`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Blog comments';

-- Comments for anything
CREATE TABLE `wbcomment` (
  `cmtid` int(11) NOT NULL auto_increment,
  `namespace` varchar(32) NOT NULL,
  `xid` int(11) NOT NULL,
  `uid` int(11) default NULL,
  `xuid` int(11) default NULL default 0, /* origin user id */
  `approved` tinyint(1) NOT NULL default 0,
  `created` datetime NOT NULL,
  `changed` datetime default NULL,
  `commentbody` blob NOT NULL,
  `deleted` tinyint(1) NOT NULL default 0,
  PRIMARY KEY  (`cmtid`),
  KEY `namespaceidix` (`namespace`, `xid`),
  KEY `uid` (`uid`),
  KEY `xuid` (`xuid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Comments for anything';

-- Ratings for anything
CREATE TABLE `wbrating` (
  `namespace` varchar(32) NOT NULL,
  `xid` int(11) NOT NULL,
  `uid` int(11) default NULL,
  `created` datetime NOT NULL,
  `value` int(11) NOT NULL default 0,
  `deleted` tinyint(1) NOT NULL default 0,
  KEY `namespaceidix` (`namespace`, `xid`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Ratings for anything';

-- URLs
CREATE TABLE `wburl` (
  `urlid` int(10) NOT NULL AUTO_INCREMENT,
  `protocol` varchar(10) NOT NULL  DEFAULT "",
  `host` varchar(127) NOT NULL DEFAULT "",
  `path` varchar(205) NOT NULL DEFAULT "",
  `title` varchar(255) NOT NULL DEFAULT "",
  `vfsfid` int(11) DEFAULT NULL DEFAULT 0,
  `description` text NOT NULL DEFAULT "",
  `headlines` text NOT NULL DEFAULT "",
  `populated` datetime NULL ,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`urlid`),
  KEY `hostpathidx` (`host`,`path`)
) ENGINE=MyISAM AUTO_INCREMENT=28824 DEFAULT CHARSET=utf8 COMMENT='List of URLs';

CREATE TABLE `wburlscreenshotqueue` (
  `urlid` int(10) NOT NULL,
  KEY  (`urlid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='List of URL ids to take screenshots';

-- (de-)references
CREATE TABLE `wbreference` (
    refid INT(11) NOT NULL AUTO_INCREMENT
     , urlid INT(11) NOT NULL DEFAULT 0
     , path VARCHAR(255) NOT NULL DEFAULT ''
     , xnamespace VARCHAR(50) NOT NULL DEFAULT ''
     , xtag VARCHAR(50) NOT NULL DEFAULT ''
     , xid INT(11) NOT NULL DEFAULT 0
     , created DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00'
     , PRIMARY KEY idxrefid (refid)
     , KEY idxref (xnamespace, xtag, xid)
     , KEY idxurl (urlid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='URLs refering to something';



-- VFS
CREATE TABLE `wbvfsfile` (
  `vfsfid` int(11) NOT NULL auto_increment,
  `obscure` varchar(2) NOT NULL,
  `vfsdid` int(11) NOT NULL,
  `uid` varchar(255) NOT NULL,
  `size` int(11) NOT NULL default '0',
  `md5` char(32) NOT NULL,
  `storage` varchar(255) NOT NULL,
  `mimemajor` varchar(75) NOT NULL,
  `mimeminor` varchar(75) NOT NULL,
  `name` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `info` BLOB,
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `changed` datetime NOT NULL,
  `deleted` tinyint(1) NOT NULL default 0,
  PRIMARY KEY  (`vfsfid`),
  KEY ( `uid` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='media file';

CREATE TABLE `wbvfsfilequota` (
  `uid` int(11) NOT NULL,
  `changed` datetime NOT NULL default '0000-00-00 00:00:00',
  `sizemax` int(11) UNSIGNED NOT NULL default '104857600',
  `filemax` int(11) UNSIGNED NOT NULL default '1000',
  PRIMARY KEY  (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='media file per user quota';


CREATE TABLE `wbvfsfilequeue` (
  `vfsfid` int(11) NOT NULL,
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`vfsfid`),
  KEY ( `created` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='media file queue';

CREATE TABLE `wbvfsdir` (
  `vfsdid` int(11) NOT NULL auto_increment,
  `uid` varchar(255) NOT NULL,
  `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '' ,
  `name` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `changed` datetime NOT NULL,
  PRIMARY KEY  (`vfsdid` ),
  KEY ( `path` ),
  KEY ( `uid` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='store per user folders';


CREATE TABLE `wbvfsfileupload` (
  `vfsuid` int(11) NOT NULL auto_increment,
  `uid` varchar(255) NOT NULL,
  `size` int(11) NOT NULL default '0',
  `md5` varchar(32) NOT NULL DEFAULT '',
  `chunks` int(11) NOT NULL default '0',
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY  (`vfsuid`),
  KEY ( `uid` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='media file upload';

CREATE TABLE `wbvfsgallery` (
  `vfsgid` int(11) NOT NULL auto_increment,
  `obscure` varchar(2) NOT NULL,
  `uid` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL default '',
  `description` BLOB,
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `changed` datetime NOT NULL,
  `deleted` tinyint(1) NOT NULL default 0,
  PRIMARY KEY  (`vfsgid`),
  KEY ( `uid` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='media file gallery';

CREATE TABLE `wbvfsgalleryfile` (
  `vfsgid` int(11) NOT NULL,
  `vfsfid` int(11) NOT NULL,
  KEY (`vfsgid`),
  KEY (`vfsfid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='media file gallery file reference';

CREATE TABLE `wbconfig` (
  `pathcs` char(32) NOT NULL default '',
  `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '' ,
  `branch` varchar(255) NOT NULL default '',
  `uid` int(11) NOT NULL,
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `changed` datetime NOT NULL,
  `config` text NOT NULL,
  PRIMARY KEY  (`pathcs` ),
  KEY ( `path` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='XML config';

CREATE TABLE `wbmenu` (
  `menu` varchar(255) NOT NULL default '',
  `menuid` int(11) NOT NULL auto_increment,
  `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '' ,
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `changed` datetime NOT NULL,
  `position` smallint(3) NOT NULL default 0,
  `urlid` int(11) NOT NULL default 0,
  `linktext` varchar(255) NOT NULL default '',
  `tooltip` text NOT NULL default '',
  `class` varchar(255) NOT NULL default '',
  `requireuser` enum('anybody', 'anonymous', 'user') NOT NULL default 'anybody',
  `requiregroup` int(11) NOT NULL default 0,
  PRIMARY KEY  (`menuid` ),
  KEY ( `path` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='page menu';


CREATE TABLE wbtableindex (
    xid int(11) unsigned NOT NULL,
    namespace varchar(50) NOT NULL DEFAULT '',
    word varchar(255) NOT NULL DEFAULT '',
    KEY word (namespace, word)
);

/**
 * Key value pairs
 */
CREATE TABLE wbkeyvaluepairkey (
    keyid int(11) unsigned NOT NULL auto_increment,
    `domain` varchar(128) NOT NULL DEFAULT '',
    word varchar(128) NOT NULL DEFAULT '',
    PRIMARY KEY keyid (keyid),
    KEY word (`domain`, word)
);

CREATE TABLE wbkeyvaluepairvalue (
    valueid int(11) unsigned NOT NULL auto_increment,
    word text NOT NULL DEFAULT '',
    PRIMARY KEY valueid (valueid)
);

CREATE TABLE wbkeyvaluepairkeyvalueid (
    keyvalueid int(11) unsigned NOT NULL auto_increment,
    created datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY keyvalueid (keyvalueid)
);

CREATE TABLE wbkeyvaluepairkeyvalue (
    keyvalueid int(11) unsigned NOT NULL,
    keyid int(11) unsigned NOT NULL,
    valueid int(11) unsigned NOT NULL,
    KEY keyvalueid (keyvalueid)
);
