




CREATE TABLE `opl_auditTrail` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gid` varchar(40) NOT NULL,
  `responsible` int(10) unsigned NOT NULL,
  `cid` int(10) unsigned NOT NULL,
  `type` varchar(150) DEFAULT NULL,
  `oldVal` varchar(50) DEFAULT NULL,
  `newVal` varchar(50) DEFAULT NULL,
  `note` varchar(254) DEFAULT '',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  KEY `logKey` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `opl_bgJob` (
  `jobId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `job` text,
  `signature` varchar(100) DEFAULT NULL,
  `status` enum('waiting','processing','done','error') DEFAULT 'waiting',
  `jobDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `output` blob,
  PRIMARY KEY (`jobId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE `opl_bgJobItem` (
  `jobId` int(10) NOT NULL DEFAULT '0',
  `rid` int(10) unsigned NOT NULL DEFAULT '0',
  `barcode` varchar(50) NOT NULL DEFAULT '',
  `status` enum('waiting','processing','done','error') DEFAULT 'waiting',
  KEY `key_id` (`jobId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE `opl_serviceFee` (
  `sf_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL,
  `responsible` int(10) unsigned NOT NULL,
  `type` varchar(150) NOT NULL,
  `ammount` float(10,2) NOT NULL DEFAULT '0.00',
  `onDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `description` text,
  PRIMARY KEY (`sf_id`),
  KEY `NewIndex` (`sf_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `opl_userRelation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL,
  `relUid` int(10) unsigned NOT NULL,
  `relType` varchar(50) DEFAULT NULL,
  `role` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uid_relUid` (`uid`,`relUid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `opl_genre` (
  `gId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `author` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `introduction` text CHARACTER SET latin1,
  `createdDate` datetime DEFAULT NULL,
  `modDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`gId`),
  KEY `key1` (`title`,`author`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `opl_genreItems` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gId` int(10) unsigned NOT NULL,
  `groupId` int(10) unsigned NOT NULL DEFAULT '1',
  `iOrder` int(10) unsigned NOT NULL DEFAULT '1',
  `rid` int(10) unsigned NOT NULL,
  `callNumber` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `opl_genreGroup` (
  `groupId` int(10) unsigned NOT NULL DEFAULT '0',
  `gId` int(10) unsigned NOT NULL,
  `header` varchar(255) DEFAULT NULL,
  `description` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



alter table opl_user change  `modified` `modified`  timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
                     change homeroom homeroom varchar(100) default NULL,
                     change buildingcode buildingcode varchar(10) default '',
                     change teacher teacher varchar(100) default NULL,
                     change grade grade varchar(10) default '',
                     change `sysCode` `sysCode`varchar(10) DEFAULT NULL,
                     change `libCode` `libCode` varchar(10) DEFAULT NULL,
                         add  `middlename` varchar(50) DEFAULT NULL after lastname,
                         add  `fullname` varchar(150) after middlename,
                         add  `nickname` varchar(50) DEFAULT NULL after fullname,
                         add  `country` varchar(25) DEFAULT NULL after state,
                         add   `privateNotes` mediumtext after notes,
                         add   `issueBy` varchar(50) DEFAULT NULL,
                         add   `biometricLnk` varchar(255) DEFAULT NULL,
                         add   `digitalSign` varchar(50) DEFAULT NULL,
                         add   `workPhone` varchar(50) DEFAULT NULL,
                         add   `neighborhood` varchar(50) DEFAULT NULL,
                         add   `residency` varchar(250) DEFAULT NULL,
                         add   `addrLine1_alt` varchar(200) DEFAULT NULL,
                         add   `addrLine2_alt` varchar(200) DEFAULT NULL,
                         add   `city_alt` varchar(50) DEFAULT NULL,
                         add   `zip_alt` varchar(20) DEFAULT NULL,
                         add   `state_alt` char(2) DEFAULT NULL,
                         add   `country_alt` varchar(25) DEFAULT NULL,
                         add   `neighborhood_alt` varchar(50) DEFAULT NULL,
                         add   `residency_alt` varchar(250) DEFAULT NULL,
                         add   `addrExpiry_alt` datetime DEFAULT NULL,
                         add   `program` varchar(200) DEFAULT NULL,
                         add   `studies` varchar(200) DEFAULT NULL,
                         add   `permanent` enum('true','false') DEFAULT 'true',
                         add   `fulltime` enum('true','false') DEFAULT 'true',
                         add   `identification` varchar(100) DEFAULT NULL,
                         add   `pref_contact` varchar(200) DEFAULT NULL;

update opl_user set categorycode=null where uid=1;

alter table opl_delUser change  `modified` `modified`  timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
                     change homeroom homeroom varchar(100) default NULL,
                     change buildingcode buildingcode varchar(10) default '',
                     change teacher teacher varchar(100) default NULL,
                     change grade grade varchar(10) default '',
                     change `sysCode` `sysCode`varchar(10) DEFAULT NULL,
                     change `libCode` `libCode` varchar(10) DEFAULT NULL,
                         add  `middlename` varchar(50) DEFAULT NULL after lastname,
                         add  `fullname` varchar(150) after middlename,
                         add  `nickname` varchar(50) DEFAULT NULL after fullname,
                         add  `country` varchar(25) DEFAULT NULL after state,
                         add   `privateNotes` mediumtext after notes,
                         add   `issueBy` varchar(50) DEFAULT NULL,
                         add   `biometricLnk` varchar(255) DEFAULT NULL,
                         add   `digitalSign` varchar(50) DEFAULT NULL,
                         add   `workPhone` varchar(50) DEFAULT NULL,
                         add   `neighborhood` varchar(50) DEFAULT NULL,
                         add   `residency` varchar(250) DEFAULT NULL,
                         add   `addrLine1_alt` varchar(200) DEFAULT NULL,
                         add   `addrLine2_alt` varchar(200) DEFAULT NULL,
                         add   `city_alt` varchar(50) DEFAULT NULL,
                         add   `zip_alt` varchar(20) DEFAULT NULL,
                         add   `state_alt` char(2) DEFAULT NULL,
                         add   `country_alt` varchar(25) DEFAULT NULL,
                         add   `neighborhood_alt` varchar(50) DEFAULT NULL,
                         add   `residency_alt` varchar(250) DEFAULT NULL,
                         add   `addrExpiry_alt` datetime DEFAULT NULL,
                         add   `program` varchar(200) DEFAULT NULL,
                         add   `studies` varchar(200) DEFAULT NULL,
                         add   `permanent` enum('true','false') DEFAULT 'true',
                         add   `fulltime` enum('true','false') DEFAULT 'true',
                         add   `identification` varchar(100) DEFAULT NULL,
                         add   `pref_contact` varchar(200) DEFAULT NULL;

alter table opl_loan add   `timeOnShelvingCart` int(5) unsigned DEFAULT '0';

alter table opl_odl add `responsible` int(10) unsigned DEFAULT NULL after `odl_id` ,
                    add  `note` text,
                    change `type` `type` set('overdue','lost','damaged','claimNeverLoaned','claimReturned') DEFAULT 'overdue';


alter table opl_itemType add `timeOnShelvingCart` int(5) unsigned DEFAULT '0';
alter table opl_itemTypeParam add `maxItemLoan` tinyint(3) unsigned DEFAULT '0';
update opl_itemTypeParam p inner join opl_category c on c.catid=p.userTypeId set p.maxItemLoan=c.maxloans;

alter table opl_category add `allowUserEdit` varchar(100) DEFAULT '' after catname;

alter table opl_guardian add `gcountry` varchar(25) DEFAULT NULL after gstate,
                         add `role` varchar(25) DEFAULT NULL ;


insert into opl_preference(var,val,valShow,opt,varType,description,hidden,gid,gOrder) values
('libraryType','k-12','k-12',null,'radio','Library type; K-12, college or public',0,1,7),
('disableLibCat','0','Disabled','0|1','radio','Enable / Disable : library catalog module',1,null,null);


alter table opl_inventory add `callNumberSort` varchar(100) DEFAULT NULL after callNumber;

CREATE TABLE `opl_tmpLocation` (
  `locName` varchar(150) NOT NULL DEFAULT '',
  `resetLocOnReturn` tinyint(2) DEFAULT '1',
  PRIMARY KEY (`locName`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



truncate table `opl_permission`;
INSERT INTO `opl_permission` VALUES (1,1,'User Add','user_add'),
    (2,1,'User Edit','user_edit'),
    (3,1,'User Delete','user_delete'),
    (4,6,'Marc Edit','marc_edit'),
    (5,3,'Pref Edit','pref_edit'),
    (6,4,'Circ Loan','circ_loan'),
    (7,4,'Circ Return','circ_return'),
    (8,4,'Circ Reserve','circ_rsrv'),
    (9,4,'Self-Reserve','circ_rsrv_self'),
    (10,17,'Collect','fine'),
    (12,4,'Notice','notice'),
    (44,6,'Delete record','marc_del'),
    (14,4,'Email Bib','bibsrc'),
    (15,5,'Path Finder','pf'),
    (16,5,'Rating','rating'),
    (18,7,'Record Edit','tb_record_edit'),
    (11,4,'Payment','payment'),
    (19,9,'Circ Loan','tb_circ_loan'),
    (20,9,'Circ Return','tb_circ_return'),
    (21,9,'Circ Reserve','tb_circ_rsrv'),
    (22,9,'Self-Reserve','tb_circ_rsrv_self'),
    (23,9,'Fine','tb_fine'),
    (24,9,'Notice','tb_notice'),
    (25,9,'Report','tb_report'),
    (27,12,'Record Edit','eq_record_edit'),
    (28,14,'Circ Loan','eq_circ_loan'),
    (29,14,'Circ Return','eq_circ_return'),
    (30,14,'Circ Reserve','eq_circ_rsrv'),
    (31,14,'Self-Reserve','eq_circ_rsrv_self'),
    (32,14,'Report','eq_report'),
    (43,6,'Add new record','marc_add'),
    (26,10,'Course','tb_course_edit'),
    (33,4,'ILL Filter','circ_ill_filter'),
    (34,5,'eBook Mgmt','ebook_mgmt'),
    (35,16,'User','rpt_user'),
    (36,16,'Circ','rpt_circ'),
    (37,16,'Catalog Rec','rpt_catRec'),
    (38,16,'Fine','rpt_fine'),
    (39,16,'Notice','rpt_notice'),
    (41,17,'Adjust','fine_edit'),
    (42,17,'Waive','fine_waive'),
    (45,6,'Merge records','marc_merge'),
    (46,6,'Export records','marc_export'),
    (47,1,'User Permissions Change','user_permEdit'),
    (48,5,'Genre','genre'),
    (49,5,'Reserve Shelf','rsrv_shelf');



truncate table  `opl_transCode`;
alter table `opl_transCode` add  `code_str` varchar(50) DEFAULT NULL after code ;


INSERT INTO `opl_transCode` VALUES 
    (1,'OVERDUE_CHARGED','overdue charged',''),
    (2,'LOST_CHARGED','lost charged',''),
    (3,'DAMAGE_CHARGED','damage charged',''),
    (4,'PAYMENT','payment',''),
    (5,'FORGIVE','forgive',''),
    (6,'CREDIT_REFUND','credit refund',''),
    (7,'RATE_ADJUSTMENT','rate adjustment',''),
    (8,'REFUND','refund',''),
    (9,'SERVICE_FEE','service fee',''),
    (10,'CREDIT_USED','credit used',''),
    (11,'PAY_FROM_CREDIT','pay from credit','');




truncate table `opl_permGroup`;
INSERT INTO `opl_permGroup` VALUES 
    (1,1,'User'),
    (2,3,'Marc'),
    (3,1,'System'),
    (4,2,'Circ'),
    (5,2,'Misc'),
    (7,3,'Marc'),
    (9,3,'Circ'),
    (10,3,'Misc'),
    (12,4,'Marc'),
    (14,4,'Circ'),
    (16,2,'Report'),
    (17,2,'Fine'),
    (6,2,'Marc');





truncate table `opl_subSystem`;
INSERT INTO `opl_subSystem` VALUES 
    (2,'Library'),
    (3,'Textbook'),
    (4,'Equipment'),
    (1,'System management');






truncate table `opl_prefFormParam`;

INSERT INTO `opl_prefFormParam` VALUES 
    ('allowOverdue',0,'override automatically without approval','2'),
    ('allowOverdue',0,'override with question','1'),
    ('allowOverdue',0,'no override','0'),
    ('autoAdd2NewItemList',0,'On','1'),
    ('autoAdd2NewItemList',1,'Off','0'),
    ('autoUpdateUnion',0,'Enable','1'),
    ('autoUpdateUnion',1,'Disable','0'),
    ('barcodeType',0,'default','0'),
    ('barcodeType',0,'Follett','1'),
    ('barcodeType',0,'Spectrum','2'),
    ('barcodeType',0,'Alexandria-Leading Zeros','3'),
    ('bibformat',0,'APA','apa'),
    ('bibformat',0,'MLA','mla'),
    ('bibformat',0,'Shelf','shelf'),
    ('bibTimeclear',0,'minute','m'),
    ('bibTimeclear',1,'hour','h'),
    ('bibTimeclear',2,'day','d'),
    ('charge_damage',0,'On','1'),
    ('charge_damage',1,'Off','0'),
    ('charge_lost',0,'On','1'),
    ('charge_lost',1,'Off','0'),
    ('charge_overdue',0,'On','1'),
    ('charge_overdue',1,'Off','0'),
    ('circulationSound',0,'On','1'),
    ('circulationSound',1,'Off','0'),
    ('defaultSearchPage',0,'standard','0'),
    ('defaultSearchPage',0,'beginner','1'),
    ('defaultSearchPage',0,'advance','2'),
    ('defaultSearchPage',0,'OWL Beginner Interface','3'),
    ('equipmentMgmnt',0,'Enable','1'),
    ('equipmentMgmnt',1,'Disable','0'),
    ('fine',0,'On','1'),
    ('fine',1,'Off','0'),
    ('lang',0,'English','en'),
    ('lang',1,'French','fr'),
    ('multilingual',0,'English','en'),
    ('multilingual',1,'French','fr'),
    ('OWLBgSrchFields',2,'author','author'),
    ('OWLBgSrchFields',0,'keyword','keyword'),
    ('OWLBgSrchFields',1,'title','title'),
    ('patronItemPrivacy',0,'On','1'),
    ('patronItemPrivacy',1,'Off','0'),
    ('rating',0,'disable the reader rating item','0'),
    ('rating',0,'enable the reader rating item in expand record page','1'),
    ('rating',0,'enable the reader rating item in search result and expand record pages','2'),
    ('showARL',0,'On','1'),
    ('showARL',1,'Off','0'),
    ('showBeginnerSrch',0,'Hide all','0'),
    ('showBeginnerSrch',0,'Show all','1'),
    ('showBeginnerSrch',0,'show Beginner only','2'),
    ('showBeginnerSrch',0,'show OWL beginner only','3'),
    ('showLocation',0,'On','1'),
    ('showLocation',1,'Off','0'),
    ('showPathfinder',0,'On','1'),
    ('showPathfinder',1,'Off','0'),
    ('textbookChargeDamage',0,'On','1'),
    ('textbookChargeDamage',1,'Off','0'),
    ('textbookChargeLost',0,'On','1'),
    ('textbookChargeLost',1,'Off','0'),
    ('textbookChargeOverdue',0,'On','1'),
    ('textbookChargeOverdue',1,'Off','0'),
    ('textbookFine',0,'On','1'),
    ('textbookFine',1,'Off','0'),
    ('textbookMgmnt',0,'Enable','1'),
    ('textbookMgmnt',1,'Disable','0'),
    ('timeclear',0,'minute','m'),
    ('timeclear',1,'hour','h'),
    ('timeclear',2,'day','d'),
    ('timeout',0,'minute','m'),
    ('timeout',1,'hour','h'),
    ('timeout',2,'day','d'),
    ('unionCircUpdate',0,'Enable','1'),
    ('unionCircUpdate',1,'Disable','0'),
    ('useHolidays',0,'Extend loan period a day for each holiday','1'),
    ('useHolidays',0,'Count holiday as part of loan period','0'),
    ('validateBarcode',0,'Enable','1'),
    ('validateBarcode',1,'Disable','0'),
    ('timezone',13,'(GMT  0.0) Western Europe Time, London, Lisbon, Casablanca','Europe/London'),
    ('timezone',14,'(GMT +1.0) Brussels, Copenhagen, Madrid, Paris','Europe/Brussels'),
    ('timezone',24,'(GMT +10.0) Eastern Australia, Guam, Vladivostok','Australia/Sydney'),
    ('timezone',25,'(GMT +11.0) Magadan, Solomon Islands, New Caledonia','Asia/Magadan'),
    ('timezone',26,'(GMT +12.0) Auckland, Wellington, Fiji, Kamchatka','Pacific/Fiji'),
    ('timezone',15,'(GMT +2.0) Kaliningrad, South Africa','Europe/Kaliningrad'),
    ('timezone',16,'(GMT +3.0) Baghdad, Riyadh, Moscow, St. Petersburg','Europe/Moscow'),
    ('timezone',16,'(GMT +3.5) Tehran','Asia/Tehran'),
    ('timezone',17,'(GMT +4.0) Abu Dhabi, Muscat, Baku, Tbilisi','Asia/Baku'),
    ('timezone',17,'(GMT +4.5) Kabul','Asia/Kabul'),
    ('timezone',18,'(GMT +5.0) Ekaterinburg, Islamabad, Karachi, Tashkent','Asia/Karachi'),
    ('timezone',18,'(GMT +5.5) Bombay, Calcutta, Madras, New Delhi','Indian/Maldives'),
    ('timezone',19,'(GMT +6.0) Almaty, Dhaka, Colombo','Asia/Almaty'),
    ('timezone',20,'(GMT +7.0) Bangkok, Hanoi, Jakarta','Asia/Bangkok'),
    ('timezone',21,'(GMT +8.0) Beijing, Perth, Singapore, Hong Kong','Asia/Hong_Kong'),
    ('timezone',22,'(GMT +9.0) Tokyo, Seoul, Osaka, Sapporo, Yakutsk','Asia/Tokyo'),
    ('timezone',23,'(GMT +9.5) Adelaide, Darwin','Australia/Adelaide'),
    ('timezone',12,'(GMT -1.0) Azores, Cape Verde Islands','Atlantic/Azores'),
    ('timezone',2,'(GMT -10.0) Hawaii','Pacific/Honolulu'),
    ('timezone',1,'(GMT -11.0) Midway Island, Samoa','Pacific/Midway'),
    ('timezone',0,'(GMT -12.0) Eniwetok, Kwajalein','Pacific/Kwajalein'),
    ('timezone',11,'(GMT -2.0) Mid-Atlantic','America/Noronha'),
    ('timezone',9,'(GMT -3.0) Brazil, Buenos Aires, Georgetown','America/Sao_Paulo'),
    ('timezone',10,'(GMT -3.5) Newfoundland','America/St_Johns'),
    ('timezone',8,'(GMT -4.0) Atlantic Time (Canada), Caracas, La Paz','America/Caracas'),
    ('timezone',7,'(GMT -5.0) Eastern Time (US &amp; Canada), Bogota, Lima','America/Montreal'),
    ('timezone',7,'(GMT -5.0) Jamaica, Lima, Peru, Panama','America/Jamaica'),
    ('timezone',6,'(GMT -6.0) Central Time (US &amp; Canada), Mexico City','America/Chicago'),
    ('timezone',5,'(GMT -7.0) Mountain Time (US &amp; Canada)','America/Edmonton'),
    ('timezone',4,'(GMT -8.0) Pacific Time (US &amp; Canada)','America/Vancouver'),
    ('timezone',3,'(GMT -9.0) Alaska','America/Anchorage'),
    ('OWLBgSrchFields',3,'subject','subject'),
    ('defaultSearchResultSort',0,'Publication date','31'),
    ('defaultSearchResultSort',1,'Title','4'),
    ('defaultSearchResultSort',2,'Author','1003'),
    ('defaultSearchResultSort',3,'Callnumber','5001'),
    ('defaultSearchResultSort',4,'Location','8008'),
    ('defaultSearchResultSort',5,'Relevance','0'),
    ('bookingReserve',0,'On','1'),
    ('bookingReserve',1,'Off','0'),
    ('googlePreview',0,'On','1'),
    ('googlePreview',1,'Off','0'),
    ('multilingual',3,'Portuguese','pt'),
    ('lang',2,'Spanish','es'),
    ('registerAccount',1,'Off','0'),
    ('registerAccount',0,'On','1'),
    ('multilingual',2,'Spanish','es'),
    ('lang',3,'Portuguese','pt'),
    ('hit_counter',0,'On','1'),
    ('hit_counter',1,'Off','0'),
    ('multilingual',4,'Arabic','ar'),
    ('lang',4,'Arabic','ar'),
    ('classificationSystem',0,'Dewey Decimal System','dewey'),
    ('classificationSystem',1,'Library of Congress classification','LCC'),
    ('barcodeType',0,'Sagebrush','4'),
    ('OpacLoginRequired',1,'Yes','1'),
    ('OpacLoginRequired',0,'No','0'),
    ('slipPrinter',1,'Disable','0'),
    ('slipPrinter',0,'Enable','1'),
    ('selfcreateAccount',1,'off','0'),
    ('selfcreateAccount',1,'on','1'),
    ('unionExportExcludeTypes',1,'book','book'),
    ('unionExportExcludeTypes',2,'bookManuscript','bookManuscript'),
    ('unionExportExcludeTypes',3,'ebook','ebook'),
    ('unionExportExcludeTypes',4,'journal','journal'),
    ('unionExportExcludeTypes',5,'serial','serial'),
    ('unionExportExcludeTypes',6,'electronicMedia','electronicMedia'),
    ('unionExportExcludeTypes',7,'internet','internet'),
    ('unionExportExcludeTypes',8,'compactDisc','compactDisc'),
    ('unionExportExcludeTypes',9,'map','map'),
    ('unionExportExcludeTypes',10,'mapManuscript','mapManuscript'),
    ('unionExportExcludeTypes',11,'bookOnTape','bookOnTape'),
    ('unionExportExcludeTypes',13,'musicCassette','musicCassette'),
    ('unionExportExcludeTypes',14,'CDMusic','CDMusic'),
    ('unionExportExcludeTypes',15,'manuscriptMusic','manuscriptMusic'),
    ('unionExportExcludeTypes',16,'sheetMusic','sheetMusic'),
    ('unionExportExcludeTypes',17,'artifact','artifact'),
    ('unionExportExcludeTypes',18,'photoPoster','photoPoster'),
    ('unionExportExcludeTypes',19,'libraryKit','libraryKit'),
    ('unionExportExcludeTypes',20,'mixedMaterial','mixedMaterial'),
    ('unionExportExcludeTypes',21,'movie','movie'),
    ('unionExportExcludeTypes',22,'videocassette','videocassette'),
    ('unionExportExcludeTypes',23,'DVD','DVD'),
    ('unionExportExcludeTypes',24,'blu_ray','blu_ray'),
    ('ebookModule',0,'Enable','1'),
    ('ebookModule',1,'Disable','0'),
    ('showLocationFilter',0,'Enable','1'),
    ('showLocationFilter',1,'Disable','0'),
    ('ILL_Messaging',0,'Enable','1'),
    ('ILL_Messaging',1,'Disable','0'),
    ('libraryType',1,'k-12','k-12'),
    ('libraryType',2,'College/University','academy'),
    ('libraryType',3,'Public Library','public');

update opl_category c inner join opl_user u on u.categorycode=c.catid set c.allowUserEdit='0' 
where permissions regexp 'user_add' && permissions regexp 'user_edit' && categorycode is not null;

