DROP TABLE IF EXISTS attachment;

CREATE TABLE `attachment` (
  `id` int(11) NOT NULL auto_increment,
  `aid` int(11) NOT NULL,
  `attach` varchar(1000) collate utf8_unicode_ci NOT NULL,
  `uploadtime` datetime NOT NULL,
  `filetype` varchar(50) collate utf8_unicode_ci NOT NULL,
  `filesize` varchar(100) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=105 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS comment;

CREATE TABLE `comment` (
  `id` int(11) NOT NULL auto_increment,
  `aid` int(11) NOT NULL,
  `content` varchar(300) collate utf8_unicode_ci NOT NULL,
  `time` time NOT NULL,
  `ip` varchar(40) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS nclass;

CREATE TABLE `nclass` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS news;

CREATE TABLE `news` (
  `id` int(11) NOT NULL auto_increment,
  `aid` int(11) NOT NULL,
  `bigclassid` int(11) NOT NULL,
  `smallclassid` int(11) NOT NULL,
  `time` date NOT NULL,
  `ip` varchar(50) collate utf8_unicode_ci NOT NULL,
  `content` text collate utf8_unicode_ci NOT NULL,
  `iscomment` tinyint(1) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS pclass;

CREATE TABLE `pclass` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) collate utf8_bin NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=68 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

DROP TABLE IF EXISTS product;

CREATE TABLE `product` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(50) collate utf8_unicode_ci NOT NULL,
  `time` datetime NOT NULL,
  `bigclassid` int(11) NOT NULL,
  `content` text collate utf8_unicode_ci NOT NULL,
  `iscomment` tinyint(1) NOT NULL,
  `editor` varchar(50) collate utf8_unicode_ci NOT NULL,
  `attach` varchar(2000) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=83 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS userinfo;

CREATE TABLE `userinfo` (
  `id` int(11) NOT NULL auto_increment,
  `username` char(20) collate utf8_unicode_ci NOT NULL,
  `password` varchar(40) collate utf8_unicode_ci NOT NULL,
  `logintime` datetime NOT NULL,
  `loginip` varchar(40) collate utf8_unicode_ci NOT NULL,
  `logincount` int(11) NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

