CREATE TABLE pw_debateclass (
  cid smallint(6) unsigned NOT NULL auto_increment,
  cname char(20) NOT NULL,
  PRIMARY KEY  (cid),
  KEY cname (cname)
) TYPE=MyISAM;

INSERT INTO pw_debateclass VALUES (1, 'ѧ');
INSERT INTO pw_debateclass VALUES (2, 'Ӱ');
INSERT INTO pw_debateclass VALUES (3, 'ʱ');
INSERT INTO pw_debateclass VALUES (4, '');
INSERT INTO pw_debateclass VALUES (5, '');
INSERT INTO pw_debateclass VALUES (6, '̬');
INSERT INTO pw_debateclass VALUES (7, '');

CREATE TABLE pw_debateinfo (
  uid int(10) NOT NULL,
  author varchar(20) NOT NULL,
  posts int(6) NOT NULL,
  replys int(6) NOT NULL,
  PRIMARY KEY  (uid),
  KEY posts (posts),
  KEY replys (replys)
) TYPE=MyISAM;

CREATE TABLE pw_debatereplys (
  aid int(10) unsigned NOT NULL auto_increment,
  did int(10) unsigned NOT NULL default '0',
  authorid int(10) unsigned NOT NULL default '0',
  author char(15) NOT NULL,
  debatetype enum('0','1','2','3') default '0',
  parentid int(10) unsigned NOT NULL default '0',
  child int(10) unsigned NOT NULL default '0',
  vote int(10) unsigned NOT NULL default '0',
  title varchar(255) NOT NULL,
  content mediumtext NOT NULL,
  dateline int(10) NOT NULL default '0',
  ip varchar(40) NOT NULL,
  isvisible enum('0','1') NOT NULL default '0',
  islock enum('0','1') NOT NULL default '0',
  isdigest enum('0','1') NOT NULL default '0',
  PRIMARY KEY  (aid)
) TYPE=MyISAM;

CREATE TABLE pw_debatethreads (
  did int(10) unsigned NOT NULL auto_increment,
  sortid tinyint(2) NOT NULL default '0',
  authorid int(10) unsigned NOT NULL,
  author char(10) NOT NULL,
  judgment char(10) NOT NULL,
  title varchar(255) NOT NULL,
  obtitle varchar(255) NOT NULL,
  retitle varchar(255) NOT NULL,
  content mediumtext NOT NULL,
  dateline int(10) unsigned NOT NULL default '0',
  endtime int(10) unsigned NOT NULL default '0',
  obvote int(10) unsigned NOT NULL default '0',
  revote int(10) unsigned NOT NULL default '0',
  voteuid mediumtext NOT NULL,
  views int(10) unsigned NOT NULL default '0',
  ip varchar(40) NOT NULL,
  isvisible tinyint(1) NOT NULL default '0',
  digest tinyint(1) NOT NULL,
  judg char(8) NOT NULL,
  judgcontent varchar(255) NOT NULL,
  PRIMARY KEY  (did),
  KEY dateline (dateline),
  KEY isvisible (isvisible,sortid)
) ENGINE=MyISAM;