-- <?php exit;?>
CREATE TABLE `p8_item` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(100) NOT NULL default '',
  `title_color` varchar(100) NOT NULL default '',
  `mid` mediumint(8) unsigned NOT NULL default '0',
  `uid` mediumint(8) unsigned NOT NULL default '0',
  `username` varchar(20) NOT NULL default '',
  `ip` varchar(16) NOT NULL default '',
  `views` mediumint(8) unsigned NOT NULL default '0',
  `timestamp` int(10) unsigned NOT NULL default '0',
  `update_time` int(10) unsigned NOT NULL default '0',
  `list_order` int(10) unsigned NOT NULL default '0',
  `verified` tinyint(1) NOT NULL default '0',
  `recommend` tinyint(1) NOT NULL default '0',
  `status` smallint(3) NOT NULL default '0',
  `replyer` varchar(20) NOT NULL default '',
  `reply_time` int(10) unsigned NOT NULL default '0',
  `display_order` int(10) unsigned NOT NULL default '0',
  `reply` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `mid` (`mid`,`list_order`),
  KEY `mid_id` (`mid`,`id`),
  KEY `timestamp` (`timestamp`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE `p8_model` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL DEFAULT '',
  `alias` char(30) NOT NULL DEFAULT '',
  `enabled` tinyint(1) NOT NULL DEFAULT '1',
  `verified` varchar(20) NOT NULL DEFAULT '',
  `recommend` tinyint(1) NOT NULL default '0',
  `count` int(10) unsigned NOT NULL DEFAULT '0', 
  `display_order` int(10) unsigned NOT NULL default '0',
  `post_template` varchar(50) NOT NULL default '',
  `list_template` varchar(50) NOT NULL default '',
  `view_template` varchar(50) NOT NULL default '', 
  `config` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE `p8_model_field` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `model` varchar(30) NOT NULL default '',
  `parent` mediumint(8) unsigned NOT NULL default '0',
  `name` varchar(30) NOT NULL default '',
  `alias` varchar(50) NOT NULL default '',
  `type` varchar(20) NOT NULL default '',
  `part` varchar(20) NOT NULL default '',
  `list_table` tinyint(1) NOT NULL default '0',
  `filterable` tinyint(1) NOT NULL default '0',
  `orderby` tinyint(1) NOT NULL default '0',
  `not_null` tinyint(1) unsigned NOT NULL,
  `length` varchar(10) NOT NULL default '',
  `is_unsigned` tinyint(1) unsigned NOT NULL,
  `editable` tinyint(1) unsigned NOT NULL default '1',
  `manager_editable`  tinyint(1) NULL DEFAULT '0',
  `default_value` text NOT NULL,
  `data` text NOT NULL,
  `config` text NOT NULL,
  `widget` varchar(50) NOT NULL default '',
  `widget_addon_attr` varchar(255) NOT NULL default '',
  `display_order` tinyint(3) unsigned NOT NULL,
  `units` varchar(20) NOT NULL,
  `jsreg` varchar(40) NOT NULL default '',
  `jsregmsg` varchar(20) NOT NULL default '',
  `color` varchar(10) NOT NULL default '',
  `description` varchar(100) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`model`,`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

