
# Set names, if mysql version is 4.1.x

#SET NAMES gbk;

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

ALTER TABLE usergroup ADD groupquotasize INT(10) DEFAULT 0 NOT NULL;
ALTER TABLE author ADD warmindex INT(8)  DEFAULT 0 NOT NULL;
ALTER TABLE posts ADD lastauthorid INT(10) DEFAULT 0 NOT NULL;

CREATE TABLE lybbs_post_favorite (postID INT(10) DEFAULT 0 NOT NULL, authorID INT(10) DEFAULT 0 NOT NULL, INDEX(postID,authorID));

CREATE TABLE lybbs_log (id INT (10) DEFAULT 0 NOT NULL, loglevel TINYINT (1) DEFAULT 0 NOT NULL, logaction VARCHAR (20) NOT NULL, logcontent VARCHAR (250) NOT NULL, loguser VARCHAR (40) NOT NULL, logip VARCHAR (20) NOT NULL, logtime BIGINT (13) DEFAULT 0 NOT NULL, PRIMARY KEY(id), INDEX(loglevel,logaction,loguser));