# Updates for 0.3.4

ALTER TABLE user ADD COLUMN flags MEDIUMINT(10) UNSIGNED NOT NULL AFTER flood;
ALTER TABLE chanban MODIFY type tinyint(3) unsigned NOT NULL default 0;

# No updates for 0.3.5

# Updates for 0.4.0/0.3.6

ALTER TABLE chanreg DROP COLUMN pass;
ALTER TABLE nickreg ADD COLUMN id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT FIRST, DROP PRIMARY KEY, ADD UNIQUE `nick` (`nick`), ADD PRIMARY KEY (`id`);
UPDATE chanperm SET name= 'ADMIN' WHERE name= 'PROTECT';
INSERT INTO nicktext SELECT nickreg.id, 1, 0, NULL, nickreg.quit FROM nickreg;
ALTER TABLE nickreg DROP COLUMN quit;
UPDATE chanperm SET name='UnbanSelf' WHERE name='UNBAN';
INSERT INTO chanperm SET name='UNBAN', level=5;
INSERT INTO chanperm SET name='AKickEnforce', level=5;
ALTER TABLE nickalias ADD COLUMN last int(11) unsigned NOT NULL default 0;

# Updates for 0.3.7

ALTER TABLE nickreg ADD COLUMN timezone tinyint(3) default NULL;
ALTER TABLE chanperm MODIFY COLUMN name char(16) NOT NULL default '';

# Updates for 0.3.8
INSERT INTO chanperm SET name='DICE', level=1;
ALTER TABLE silence ADD COLUMN `comment` char(100) default NULL;
ALTER TABLE chanreg ADD COLUMN `bantype` tinyint(8) unsigned NOT NULL default '2';

# Updates for 0.3.9
ALTER TABLE chanacc ADD COLUMN `last` int(10) unsigned NOT NULL default '0';
