ALTER TABLE `rm_settings` CHANGE `pm_mpesa` `pm_mpesa` TINYINT( 1 ) NOT NULL ;
ALTER TABLE `rm_settings` ADD `reg_firstname` TINYINT( 1 ) NOT NULL AFTER `buydepositucp` ,
ADD `reg_lastname` TINYINT( 1 ) NOT NULL AFTER `reg_firstname` ,
ADD `reg_address` TINYINT( 1 ) NOT NULL AFTER `reg_lastname` ,
ADD `reg_city` TINYINT( 1 ) NOT NULL AFTER `reg_address` ,
ADD `reg_zip` TINYINT( 1 ) NOT NULL AFTER `reg_city` ,
ADD `reg_country` TINYINT( 1 ) NOT NULL AFTER `reg_zip` ,
ADD `reg_state` TINYINT( 1 ) NOT NULL AFTER `reg_country` ,
ADD `reg_phone` TINYINT( 1 ) NOT NULL AFTER `reg_state` ,
ADD `reg_mobile` TINYINT( 1 ) NOT NULL AFTER `reg_phone` ,
ADD `reg_email` TINYINT( 1 ) NOT NULL AFTER `reg_mobile` ,
ADD `reg_vatid` TINYINT( 1 ) NOT NULL AFTER `reg_email` ;

ALTER TABLE `rm_users` ADD `autorenew` TINYINT( 1 ) NOT NULL ;
UPDATE rm_users SET autorenew =1 ;
ALTER TABLE `rm_users` ADD `macpswmode` TINYINT( 1 ) NOT NULL AFTER `password` ;

CREATE TABLE `rm_onlinecmtmp` (
  `username` varchar(64) NOT NULL DEFAULT '',
  `maccm` varchar(17) DEFAULT NULL,
  `cmidx` int(11) NOT NULL,
  `cmstat` tinyint(1) NOT NULL,
  `enableuser` tinyint(1) DEFAULT NULL,
  `staticipcm` varchar(15) DEFAULT NULL,
  `maccpe` varchar(17) DEFAULT NULL,
  `ipcpe` varchar(15) DEFAULT NULL,
  `ipmodecpe` tinyint(1) DEFAULT NULL,
  `cmtsid` int(11) DEFAULT NULL,
  `cmtsip` varchar(15) NOT NULL,
  `groupid` int(11) DEFAULT NULL,
  `groupname` varchar(50) DEFAULT NULL,
  `dlbytes` bigint(20) DEFAULT NULL,
  `ulbytes` bigint(20) DEFAULT NULL,
  `snrds` decimal(11,1) DEFAULT NULL,
  `snrus` decimal(11,1) DEFAULT NULL,
  `txpwr` decimal(11,1) DEFAULT NULL,
  `rxpwr` decimal(11,1) DEFAULT NULL,
  `pingtime` decimal(11,1) DEFAULT NULL,
  `uptime` varchar(30) DEFAULT NULL,
  `loss` int(3) DEFAULT NULL,
  `dsname` varchar(50) DEFAULT NULL,
  `usname` varchar(50) DEFAULT NULL,
  `dsifidx` int(11) DEFAULT NULL,
  `usifidx` int(11) DEFAULT NULL,
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  KEY `username` (`username`),
  KEY `maccm` (`maccm`),
  KEY `ipcpe` (`ipcpe`),
  KEY `groupname` (`groupname`),
  KEY `cmidx` (`cmidx`),
  KEY `cmstat` (`cmstat`),
  KEY `cmtsip` (`cmtsip`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8;

ALTER TABLE `rm_wlantmp` ENGINE = MEMORY ;
