
# Set names, if mysql version is 4.1.x

#SET NAMES gbk;

# Warnning: This script is only for LyBBS ver 6.1.MySQL to 6.2 upgrade.

CREATE TABLE lybbs_item (
  id tinyint(3) default 0 NOT NULL,
  itemname varchar(200) default '' NOT NULL,
  itemprice smallint(5) default 0 NOT NULL
) TYPE=MyISAM;

CREATE TABLE lybbs_item_apply (
  id int(10) default 0 NOT NULL,
  itemid tinyint(3) default 0 NOT NULL,
  authorid int(10) default 0 NOT NULL,
  author varchar(40) default '' NOT NULL,
  applyat bigint(13) default 0 NOT NULL,
  applystatus tinyint(1) default 0 NOT NULL
) TYPE=MyISAM;

ALTER TABLE encourage ADD jingmoney SMALLINT(4) DEFAULT 0 NOT NULL;
ALTER TABLE encourage ADD jingexperience SMALLINT(4) DEFAULT 0 NOT NULL;
ALTER TABLE encourage ADD jingcharm SMALLINT(4) DEFAULT 0 NOT NULL;
ALTER TABLE encourage ADD jingindex SMALLINT(4) DEFAULT 0 NOT NULL;
ALTER TABLE posts ADD votecondition TINYINT(2) DEFAULT 0 NOT NULL;
ALTER TABLE uploadinfo ADD filerealname VARCHAR(60) DEFAULT '' NOT NULL;
update uploadinfo set filerealname=filename;

ALTER TABLE uploadinfo ADD filepath VARCHAR(80) DEFAULT '' NOT NULL;
update uploadinfo set filepath=filename;