ALTER TABLE `virtual_users` CHANGE `editlevel` `editlevel` SMALLINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `virtual_users` CHANGE `mailprotect` `mailprotect` SMALLINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `virtual_aliases` CHANGE `mailprotect` `mailprotect` SMALLINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `maildropfilter` CHANGE `flags` `flags` SMALLINT( 2 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `virtual_users` ADD `expired` TIMESTAMP NOT NULL DEFAULT '000-00-00 00:00:00' AFTER `editlevel`;
ALTER TABLE `virtual_relayhosts` DROP `loginuser`;
ALTER TABLE `virtual_relayhosts` ADD `email` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' AFTER `domain_id`;
ALTER TABLE `virtual_relayhosts` ADD `note`  VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' AFTER `active`;
ALTER TABLE `virtual_users` ADD `toall` TINYINT(1) unsigned NOT NULL DEFAULT '1' AFTER `editlevel`;
ALTER TABLE `virtual_aliases` ADD INDEX `source` ( `domain_id` , `source`  );
ALTER TABLE `virtual_users` ADD INDEX `domain_id` ( `domain_id` ); 
#
DROP TABLE IF EXISTS `virtual_sender_relayhosts`;
DROP VIEW IF EXISTS `view_relayhost`;
#
ALTER TABLE `virtual_users_shares` CHANGE `state` `state` CHAR( 1 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '1';
#
# ### update DB version: ###
#
DROP TABLE IF EXISTS `vmail_version`;
CREATE TABLE IF NOT EXISTS `vmail_version` (`id` INT(11) unsigned NOT NULL );
INSERT INTO `vmail_version` (`id`) VALUES ('8');
#
