
# Set names, if mysql version is 4.1.x

#SET NAMES gbk;

# Warnning: This script is only for LyBBS ver 3.5.MySQL to 5.0 upgrade.

ALTER TABLE `admin` CHANGE `id` `id` SMALLINT(5)  UNSIGNED NOT NULL;
ALTER TABLE `allianceforum` CHANGE `id` `id` SMALLINT(4)  UNSIGNED NOT NULL;
ALTER TABLE `allowprivate` CHANGE `id` `id` SMALLINT(5)  UNSIGNED NOT NULL;
ALTER TABLE `announcement` CHANGE `id` `id` INT(8)  UNSIGNED NOT NULL;
ALTER TABLE `author` CHANGE `id` `id` INT(6)  UNSIGNED NOT NULL;
ALTER TABLE `banip` CHANGE `id` `id` SMALLINT(4)  UNSIGNED NOT NULL;
ALTER TABLE `banword` CHANGE `id` `id` SMALLINT(4)  UNSIGNED NOT NULL;
ALTER TABLE `db` CHANGE `id` `id` SMALLINT(4)  UNSIGNED NOT NULL;
ALTER TABLE `forum` CHANGE `id` `id` SMALLINT(4)  UNSIGNED NOT NULL;
ALTER TABLE `friend` CHANGE `id` `id` INT(6)  UNSIGNED NOT NULL;
ALTER TABLE `moneyhiddeninfo` CHANGE `id` `id` INT(10)  UNSIGNED NOT NULL;
ALTER TABLE `posts` CHANGE `id` `id` INT(10)  UNSIGNED NOT NULL;
ALTER TABLE `style` CHANGE `id` `id` SMALLINT(4)  UNSIGNED NOT NULL;
ALTER TABLE `uploadinfo` CHANGE `id` `id` MEDIUMINT(8)  UNSIGNED NOT NULL;
ALTER TABLE `usergroup` CHANGE `id` `id` SMALLINT(5)  UNSIGNED NOT NULL;
ALTER TABLE `usergroupprivilege` CHANGE `id` `id` SMALLINT(5)  UNSIGNED NOT NULL;
ALTER TABLE `vote` CHANGE `id` `id` SMALLINT(5)  UNSIGNED NOT NULL;
ALTER TABLE `voterecord` CHANGE `id` `id` BIGINT(20)  UNSIGNED NOT NULL;
ALTER TABLE `webqq` CHANGE `id` `id` INT(6)  UNSIGNED NOT NULL;

ALTER TABLE `posts` CHANGE `vote` `vote` CHAR(1)  DEFAULT "0" NOT NULL;

UPDATE config SET title='LyBBS¡ºÁèÔÆÂÛÌ³¡»',support='http://www.lybbs.net',programmer='teddy',programemail='horseye@sina.com',programqq='14606667',version= 'ver 5.0.MySQL', versionnumber= '20050401' WHERE id=1;

CREATE TABLE `reserve` (`id` SMALLINT (4) DEFAULT '0' NOT NULL, `username` VARCHAR (250) NOT NULL, `email` VARCHAR (250) NOT NULL, `registerip` VARCHAR (250) NOT NULL, `visitip` VARCHAR (250) NOT NULL,PRIMARY KEY(`id`));