RENAME TABLE `mantis`.`mantis_user_table` TO `mld_bug`.`mantis_user_table_orig`;

ALTER TABLE `smf`.`members`
ADD `mantis_protected` SMALLINT NOT NULL,
ADD `mantis_login_count` int(11) NOT NULL,
ADD `mantis_lost_password_request_count` smallint(6) NOT NULL,
ADD `mantis_failed_login_count` smallint(6) NOT NULL,
ADD `mantis_cookie_string` varchar(64) NOT NULL,
ADD `mantis_access_level` VARCHAR( 2 ) DEFAULT '25' NOT NULL;

CREATE OR REPLACE VIEW `mantis`.`mantis_user_table` AS
SELECT 
id_member AS id, member_name AS username, real_name AS realname, email_address AS email, passwd AS password, is_activated AS enabled, 
mantis_protected AS protected, mantis_access_level AS access_level, mantis_login_count AS login_count, mantis_lost_password_request_count AS lost_password_request_count, mantis_failed_login_count AS failed_login_count, mantis_cookie_string AS cookie_string, 
last_login AS last_visit, date_registered AS date_created
FROM `smf`.`members`;

UPDATE `smf`.`members` SET mantis_access_level = '90' WHERE id_group = 1;
