
update opl_category set defaultPerm=trim(leading ',' from replace(concat(replace(defaultPerm,'self_chgProfile',''),if(defaultPerm='','self_chgProfile',',self_chgProfile')),',,',',')) where allowAccessMyFile='1';

update opl_category set defaultPerm=trim(leading ',' from replace(concat(replace(defaultPerm,'self_chgPwd',''),if(defaultPerm='','self_chgPwd',',self_chgPwd')),',,',',')) where allowAccessMyFile='1';

update opl_user u inner join opl_category c on c.catid=u.categoryCode 
       set permissions=trim(leading ',' from replace(concat(replace(permissions,'self_chgPwd',''),if(permissions='','self_chgPwd',',self_chgPwd')),',,',','))
    where c.allowAccessMyFile='1';

update opl_user u inner join opl_category c on c.catid=u.categoryCode 
       set permissions=trim(leading ',' from replace(concat(replace(permissions,'self_chgProfile',''),if(permissions='','self_chgProfile',',self_chgProfile')),',,',','))
    where c.allowAccessMyFile='1';   
    
replace into opl_subSystem set id=5,name='User Self Services';
replace into opl_permGroup set id=18,ssId=5, name='Account';    
replace into opl_permission set grpId=18,code='self_chgPwd',name='Change Password'; 
replace into opl_permission set grpId=18,code='self_chgProfile',name='Profile Update';

replace into opl_preference values('renewalPolicy','0','renewal from the date the renewal is requested',NULL,'radio','Renewal date policy ',0,3,9);
replace into opl_prefFormParam values('renewalPolicy',1,'renewal from the due date',1),('renewalPolicy',0,'renewal from the date the renewal is requested',0);


CREATE TABLE IF NOT EXISTS `eq_cart` (
  `cid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(10) unsigned DEFAULT NULL,
  `rname` varchar(255) NOT NULL,
  `barcode` varchar(50) NOT NULL DEFAULT '',
  `createdDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`cid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;


CREATE TABLE IF NOT EXISTS  `eq_cartItem` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `cid` int(10) unsigned NOT NULL,
  `barcode` varchar(50) NOT NULL DEFAULT '',
  `createdDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;


