--
-- Host: localhost    Database: ztest
-- ------------------------------------------------------


--
-- Table structure for table `eq_authCtrl`
--

CREATE TABLE `eq_authCtrl` (
  `name` varchar(30) NOT NULL DEFAULT '',
  `fCode` varchar(30) NOT NULL DEFAULT '',
  `fData` varchar(255) NOT NULL DEFAULT '',
  UNIQUE KEY `authCtrlKey` (`name`,`fCode`,`fData`),
  KEY `authCtrl` (`fData`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_category`
--

CREATE TABLE `eq_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `parentId` int(10) DEFAULT '0',
  `description` varchar(150) COLLATE utf8_unicode_ci DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `eq_csvDuplicate`
--

CREATE TABLE `eq_csvDuplicate` (
  `mid` int(10) NOT NULL AUTO_INCREMENT,
  `iid` int(10) unsigned NOT NULL DEFAULT '0',
  `content` mediumtext NOT NULL,
  PRIMARY KEY (`mid`),
  KEY `i_iid` (`iid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `eq_csvImport`
--

CREATE TABLE `eq_csvImport` (
  `iid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sid` int(10) unsigned DEFAULT '0',
  `lid` int(10) unsigned DEFAULT '0',
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `sCode` varchar(50) DEFAULT NULL,
  `lCode` varchar(50) DEFAULT NULL,
  `itemType` varchar(50) DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `data` longtext,
  `header` longtext,
  `mapHeader` longtext,
  `dataDup` longtext,
  `mode` enum('autoMerge','new','replace') DEFAULT 'autoMerge',
  `cMerge` tinyint(1) unsigned DEFAULT '1',
  `countImported` int(10) unsigned DEFAULT '0',
  `countMerged` int(10) unsigned DEFAULT '0',
  `countProcessed` int(10) unsigned DEFAULT '0',
  `countTotal` int(10) unsigned NOT NULL DEFAULT '0',
  `countTotalHolding` int(10) DEFAULT NULL,
  `dateImport` datetime DEFAULT NULL,
  `dateUpload` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `mesgDigest` varchar(128) DEFAULT NULL,
  `status` enum('uploaded','rejected','processed','accepted','done','indexing') DEFAULT NULL,
  `addToNewitemList` tinyint(1) unsigned DEFAULT '0',
  `newItemExpDate` datetime DEFAULT NULL,
  PRIMARY KEY (`iid`),
  KEY `i_uid` (`uid`),
  KEY `i_lid` (`lid`),
  KEY `i_msgDigest` (`mesgDigest`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `eq_def`
--
CREATE TABLE `eq_def` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `defType` varchar(100) NOT NULL,
  `fOrder` int(10) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `reqF` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `reqD` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `display` tinyint(3) NOT NULL DEFAULT '0',
  `showOnSearch` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `showOnRecFull` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `showOnRecBrief` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `fieldType` tinyint(3) NOT NULL DEFAULT '0',
  `authCtrl` enum('0','1') DEFAULT '0',
  `fieldSize` int(3) DEFAULT '10',
  `textType` varchar(25) DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_defRequired`
--

CREATE TABLE `eq_defRequired` (
  `id` int(10) NOT NULL auto_increment,
  `defType` varchar(100) NOT NULL,
  `fOrder` int(10) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `reqF` tinyint(3) NOT NULL default '1',
  `reqD` tinyint(3) unsigned NOT NULL default '0',
  `display` tinyint(3) NOT NULL default '0',
  `fieldType` tinyint(3) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_fieldDataType`
--

CREATE TABLE `eq_fieldDataType` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `dataType` varchar(255) NOT NULL,
  `maxVal` int(3) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_geRecord`
--

CREATE TABLE `eq_geRecord` (
  `req_id` int(10) unsigned DEFAULT NULL,
  `rid` int(10) unsigned DEFAULT NULL,
  `status` enum('waiting','done','read_permission_denied','write_permission_denied') NOT NULL DEFAULT 'waiting',
  `barcode` varchar(50) DEFAULT NULL,
  UNIQUE KEY `i_req_rid` (`req_id`,`rid`,`barcode`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `eq_geRequest`
--

CREATE TABLE `eq_geRequest` (
  `req_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned DEFAULT NULL,
  `o_code` varchar(25) DEFAULT NULL,
  `n_code` varchar(25) DEFAULT NULL,
  `o_data` varchar(255) DEFAULT NULL,
  `n_data` varchar(255) DEFAULT NULL,
  `action` enum('update','append','appendF','delete','copy','transfer','updateAddNew','changeRecType','changeCategory','moveHolding') DEFAULT NULL,
  `tag` varchar(3) DEFAULT NULL,
  `frDate` datetime DEFAULT NULL,
  `toDate` datetime DEFAULT NULL,
  `reqDate` datetime DEFAULT NULL,
  `finishDate` datetime DEFAULT NULL,
  `status` enum('waiting','processing','done') NOT NULL DEFAULT 'waiting',
  `digest` varchar(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`req_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `eq_hold`
--


CREATE TABLE `eq_hold` (
  `id` int(10) NOT NULL auto_increment,
  `idReserve` int(10) unsigned NOT NULL default '0',
  `barcode` varchar(50) NOT NULL default '',
  `dateHold` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateLoan` datetime default NULL,
  `dateCancel` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `i_hold` (`idReserve`,`barcode`,`dateLoan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_images`
--

CREATE TABLE `eq_images` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rId` int(10) unsigned NOT NULL,
  `thumbnail` mediumblob,
  `filename` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mimeType` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `rId` (`rId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE `eq_inventory` (
  `invId` int(10) unsigned NOT NULL DEFAULT '0',
  `fid` int(10) unsigned NOT NULL DEFAULT '0',
  `scanOrder` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sortOrder` int(10) NOT NULL DEFAULT '0',
  `barcode` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `status` set('active','damaged','found','missing','loan','invalid','unknown','noCallNumber','scanned','misplace') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
  `updated` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `updatedStatus` set('active','damaged','found','missing','loan','invalid','unknown','noCallNumber','scanned','misplace') COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `noteDetail` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`scanOrder`),
  UNIQUE KEY `bc_invId` (`barcode`,`invId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `eq_inventoryFile`
--

CREATE TABLE `eq_inventoryFile` (
  `invId` int(10) unsigned NOT NULL DEFAULT '0',
  `fid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `fname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `mesgDigest` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dateUpload` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`fid`),
  UNIQUE KEY `u_fileUser` (`fname`,`uid`,`invId`),
  UNIQUE KEY `u_mesgDigest` (`mesgDigest`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `eq_inventoryInfo`
--

CREATE TABLE `eq_inventoryInfo` (
  `invId` int(10) NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `invDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` set('scanning','done','waiting','processing','closed') COLLATE utf8_unicode_ci DEFAULT 'scanning',
  `orderidB` int(5) unsigned DEFAULT NULL,
  `orderidE` int(5) unsigned DEFAULT NULL,
  PRIMARY KEY (`invId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `eq_itemFields`
--

CREATE TABLE `eq_itemFields` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL,
  `iid` int(10) unsigned NOT NULL,
  `sfId` int(10) NOT NULL,
  `sfValue` text NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `u_risf` (`iid`,`rid`,`sfId`),
  FULLTEXT KEY `sfValue` (`sfValue`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_itemFieldsArchive`
--

CREATE TABLE `eq_itemFieldsArchive` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(10) unsigned NOT NULL,
  `iid` int(10) unsigned NOT NULL,
  `sfId` int(10) NOT NULL,
  `sfValue` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `u_risf` (`iid`,`rid`,`sfId`),
  FULLTEXT KEY `sfValue` (`sfValue`)
) ENGINE=MyISAM AUTO_INCREMENT=32588 DEFAULT CHARSET=utf8;


--
-- Table structure for table `eq_itemStatus`
--

CREATE TABLE `eq_itemStatus` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `barcode` varchar(50) NOT NULL default '',
  `ondate` datetime default NULL,
  `status` tinyint(4) default '0',
  `note` varchar(60) default NULL,
  PRIMARY KEY  (`id`),
  KEY `index1` (`barcode`,`ondate`,`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_items`
--

CREATE TABLE `eq_items` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `iid` int(10) unsigned NOT NULL,
  `rid` int(10) unsigned NOT NULL,
  `barcode` varchar(255) NOT NULL,
  `copyNo` varchar(10) DEFAULT NULL,
  `typeId` varchar(100) default NULL,
  `available` tinyint(3) default NULL,
  `createdDate` datetime default NULL,
  `modifiedDate` datetime DEFAULT NULL,
  `deleted` enum('1','0') NOT NULL DEFAULT '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `u_rid_iid` (`iid`,`rid`),
  UNIQUE KEY `u_barcode` (`barcode`),
  FULLTEXT KEY `f_barcode` (`barcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_loan`
--

CREATE TABLE `eq_loan` (
  `id` int(10) NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `barcode` varchar(50) NOT NULL default '',
  `maxRenewal` tinyint(3) unsigned default '0',
  `dateLoan` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateDue` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateRenewal` datetime default NULL,
  `dateReturn` datetime default NULL,
  `renewalCount` tinyint(4) default '0',
  `finerate` float NOT NULL default '0',
  `status` tinyint(4) default '0',
  `type` varchar(50) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `u_bcdl` (`barcode`,`dateLoan`),
  KEY `i_loan` (`uid`,`barcode`,`dateLoan`),
  KEY `i_barcode` (`barcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `eq_locationDirectory` (
  `id` int(10) NOT NULL auto_increment,
  `level` enum('region','district','building','location')  default 'building',
  `pId` int(10) unsigned default '0',
  `code` varchar(50)  default NULL,
  `name` varchar(250)  default NULL,
  `address` varchar(250)  default NULL,
  `city` varchar(50)  default NULL,
  `state` varchar(50)  default NULL,
  `zip` varchar(25) default NULL,
  `country` varchar(25)  default NULL,
  `phone` varchar(30)  default NULL,
  `fax` varchar(30)  default NULL,
  `principalTitle` varchar(25) default '',
  `principalPosition` varchar(25) default '',
  `principalName` varchar(50)  default '',
  `principalPhone` varchar(25)  default '',
  `principalEmail` varchar(50)  default '',
  `alternateTitle` varchar(25) default '',
  `alternatePosition` varchar(25) default '',
  `alternateName` varchar(50)  default '',
  `alternatePhone` varchar(25)  default '',
  `alternateEmail` varchar(50)  default '',
  `createdDate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `modDate` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `u_code` (`code`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;


--
-- Table structure for table `eq_odl`
--

CREATE TABLE `eq_odl` (
  `odl_id` int(10) unsigned NOT NULL auto_increment,
  `idloan` int(10) unsigned default '0',
  `type` set('overdue','lost','damaged') default 'overdue',
  `days_overdue` tinyint(3) unsigned default '0',
  `ondate` datetime NOT NULL default '0000-00-00 00:00:00',
  `settleDate` datetime default NULL,
  PRIMARY KEY  (`odl_id`),
  KEY `NewIndex` (`odl_id`,`idloan`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_recordFields`
--

CREATE TABLE `eq_recordFields` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL,
  `fId` int(10) unsigned NOT NULL,
  `fValue` varchar(255) default NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `i_fValue` (`fValue`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_recordFieldsArchive`
--

CREATE TABLE `eq_recordFieldsArchive` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(10) unsigned NOT NULL,
  `fId` int(10) unsigned NOT NULL,
  `fValue` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  FULLTEXT KEY `i_fValue` (`fValue`)
) ENGINE=MyISAM AUTO_INCREMENT=4090 DEFAULT CHARSET=utf8;

--
-- Table structure for table `eq_records`
--


CREATE TABLE `eq_records` (
  `rid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rname` text NOT NULL,
  `category` varchar(255) DEFAULT '0',
  `container` enum('0','1') DEFAULT '0',
  `deleted` enum('1','0') NOT NULL DEFAULT '0',
  `indexed` enum('0','1') DEFAULT '0',
  `createdDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `logId` text,
  `modifiedDate` datetime DEFAULT NULL,
  PRIMARY KEY (`rid`),
  FULLTEXT KEY `rname` (`rname`)
) ENGINE=MyISAM CHARSET=utf8;

--
-- Table structure for table `eq_reserve`
--
CREATE TABLE `eq_reserve` (
  `id` int(10) NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `numCopyReserve` tinyint(4) default '1',
  `dateReserve` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateCancel` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `i_reserve` (`rid`,`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- Table structure for table `log`
--

CREATE TABLE `log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `module` set('library','txtbk','eqmnt') COLLATE utf8_unicode_ci DEFAULT 'library',
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `sessionid` varchar(40) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `action` varchar(50) COLLATE utf8_unicode_ci DEFAULT '',
  `datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `scriptName` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `browser` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
  `content` mediumblob,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



--
-- Table structure for table `opl_arl`
--

CREATE TABLE `opl_arl` (
  `rid` int(10) unsigned NOT NULL default '0',
  `program` varchar(100) NOT NULL default '',
  `interestLevel` varchar(50) NOT NULL default '',
  `readingLevel` varchar(50) NOT NULL default '',
  `pointValue` varchar(50) NOT NULL default '',
  `quizNum` varchar(50) NOT NULL default '',
  KEY `i_rid` (`rid`),
  KEY `i_rtilc` (`program`,`interestLevel`,`readingLevel`,`pointValue`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_bookingFor`
--

CREATE TABLE `opl_bookingFor` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `bookingId` int(10) NOT NULL default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `notes` varchar(150) default '',
  `deleted` tinyint(3) unsigned default '0',
  `createdDate` datetime default NULL,
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`),
  KEY `std_id` (`uid`),
  KEY `bookingId` (`bookingId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_bookingHold`
--

CREATE TABLE `opl_bookingHold` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `bookingId` int(10) unsigned NOT NULL,
  `barcode` varchar(50) default '',
  `rid` int(10) unsigned NOT NULL,
  `itemCategory` tinyint(3) unsigned NOT NULL default '1',
  `notes` varchar(150) default '',
  `holdDate` datetime default NULL,
  `idloan` int(10) unsigned NOT NULL default '0',
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `deleted` tinyint(3) unsigned default '0',
  PRIMARY KEY  (`id`),
  KEY `bookingId` (`bookingId`),
  KEY `barcode` (`barcode`),
  KEY `idloan` (`idloan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_bookingItem`
--

CREATE TABLE `opl_bookingItem` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `bookingId` int(10) NOT NULL default '0',
  `idReserve` int(10) unsigned default NULL,
  `rid` int(10) unsigned NOT NULL default '0',
  `itemCategory` tinyint(3) unsigned default '1',
  `numOfCopy` int(10) unsigned NOT NULL default '0',
  `notes` varchar(150) default '',
  `deleted` tinyint(3) unsigned default '0',
  `createdDate` datetime default NULL,
  `modDate` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `bookingId` (`bookingId`),
  KEY `itemCategory` (`itemCategory`),
  KEY `idReserve` (`idReserve`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_bookingRequest`
--

CREATE TABLE `opl_bookingRequest` (
  `bookingId` int(10) NOT NULL auto_increment,
  `responsible` int(10) unsigned default NULL,
  `achv_id` int(10) unsigned default '0',
  `reqUid` int(10) unsigned default '0',
  `reqFirstname` varchar(150) default NULL,
  `reqLastname` varchar(150) default NULL,
  `department` varchar(150) default NULL,
  `course` varchar(150) default NULL,
  `section` varchar(150) default NULL,
  `reserveFrom` datetime default NULL,
  `reserveTo` datetime default NULL,
  `status` enum('waiting','processing','ready','cancel','filled') default 'waiting',
  `notes` varchar(150) default '',
  `deleted` tinyint(3) unsigned default '0',
  `createdDate` datetime default NULL,
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`bookingId`),
  KEY `requestorId` (`reqUid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_category`
--

CREATE TABLE `opl_category` (
  `catid` int(10) unsigned NOT NULL auto_increment,
  `cattype` varchar(30) NOT NULL,
  `catname` varchar(30) default NULL,
  `allowUserEdit` varchar(100) DEFAULT '',
  `maxloans` int(10) unsigned NOT NULL default '1',
  `maxreserv` int(10) unsigned NOT NULL default '1',
  `ODexempt` smallint(3) unsigned DEFAULT '0',
  `required` enum('0','1') NOT NULL default '0',
  `allowAccessMyFile` enum('0','1') NOT NULL DEFAULT '1',
  `authenticateBySID` enum('0','1') NOT NULL DEFAULT '0',
  `defaultPerm` text,
  `keepLoanHistory` tinyint(4) DEFAULT '1',
  PRIMARY KEY  (`catid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_cmntRating`
--

CREATE TABLE `opl_cmntRating` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '0',
  `reviewerUid` int(10) unsigned NOT NULL default '0',
  `rate` smallint(5) unsigned default '0',
  `comment` text,
  `t_lastname` varchar(50) DEFAULT NULL,
  `t_firstname` varchar(50) DEFAULT NULL,
  `reviewed` int(2) unsigned default '0',
  `accepted` int(2) unsigned default '0',
  `firstname` varchar(50) default NULL,
  `lastname` varchar(50) default NULL,
  `note` text,
  `cmntDate`   datetime DEFAULT NULL,
  `reviewDate` datetime default NULL,
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `deleted` tinyint(3) unsigned DEFAULT '0',
  PRIMARY KEY  (`id`),
  KEY `ind_deleted` (`deleted`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_collectionStats`
--

CREATE TABLE `opl_collectionStats` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `onDate` date NOT NULL,
  `status` enum('add','lost','delete','found') NOT NULL,
  `record_Holding` enum('record','holding') NOT NULL default 'holding',
  `print` int(10) unsigned default '0',
  `nonPrint` int(10) unsigned default '0',
  `fiction` int(10) unsigned default '0',
  `nonFiction` int(10) unsigned default '0',
  `pro` int(10) unsigned default '0',
  `ref` int(10) unsigned default '0',
  `serial` int(10) unsigned default '0',
  `shortStories` int(10) unsigned default '0',
  `video` int(10) unsigned default '0',
  `audio` int(10) unsigned default '0',
  `multiMedia` int(10) unsigned default '0',
  `cassette` int(10) unsigned default '0',
  `kit` int(10) unsigned default '0',
  `mixedMaterial` int(10) unsigned default '0',
  `notatedMusic` int(10) unsigned default '0',
  `map` int(10) unsigned default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_damage`
--

CREATE TABLE `opl_damage` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `idloan` int(10) unsigned NOT NULL default '0',
  `fine` float NOT NULL default '0',
  `amount` float NOT NULL default '0',
  `ondate` datetime NOT NULL default '0000-00-00 00:00:00',
  `final` char(1) default '0',
  `fdrtax` float NOT NULL default '0',
  `prvtax` float NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_dateClosed`
--

CREATE TABLE `opl_dateClosed` (
  `dClosed` date NOT NULL default '0000-00-00',
  `dLabel` varchar(250) default NULL,
  `dUpdated` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `note` text  DEFAULT '',
  `closed` enum('0','1') DEFAULT '1',
  `imgName` varchar(250) DEFAULT '',  
  PRIMARY KEY  (`dClosed`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_delUser`
--

CREATE TABLE `opl_delUser` (
  `sysCode` varchar(10) NOT NULL DEFAULT '',
  `libCode` varchar(10) NOT NULL DEFAULT '',
  `username` varchar(20) DEFAULT NULL,
  `password` varchar(86) DEFAULT NULL,
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sid` varchar(18) DEFAULT NULL,
  `userbarcode` varchar(18) DEFAULT NULL,
  `title` varchar(5) DEFAULT NULL,
  `firstname` varchar(50) DEFAULT NULL,
  `lastname` varchar(50) DEFAULT NULL,
  `middlename` varchar(50) DEFAULT NULL,
  `fullname` text,
  `nickname` varchar(50) DEFAULT NULL,
  `addrLine1` varchar(80) DEFAULT NULL,
  `addrLine2` varchar(80) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `zip` varchar(20) DEFAULT NULL,
  `state` char(2) DEFAULT NULL,
  `country` varchar(25) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `cellphone` varchar(50) DEFAULT NULL,
  `fax` varchar(50) DEFAULT NULL,
  `email` varchar(60) DEFAULT NULL,
  `birthday` date DEFAULT NULL,
  `gender` tinyint(1) unsigned DEFAULT '0',
  `created` datetime DEFAULT NULL,
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `pw_timestamp` datetime DEFAULT NULL,
  `permission` varchar(50) DEFAULT NULL,
  `permissions` text,
  `expirydate` datetime DEFAULT NULL,
  `status` tinyint(1) unsigned DEFAULT '0',
  `categorycode` int(11) DEFAULT NULL,
  `buildingcode` varchar(10) NOT NULL DEFAULT '',
  `homeroom` varchar(100) NOT NULL,
  `teacher` varchar(100) NOT NULL DEFAULT '',
  `grade` varchar(10) NOT NULL DEFAULT '',
  `yeargraduation` smallint(5) unsigned DEFAULT '0',
  `notes` mediumtext,
  `privateNotes` mediumtext,
  `pref_lang` char(2) DEFAULT NULL,
  `pref_theme` varchar(50) DEFAULT NULL,
  `idimport` int(11) DEFAULT '0',
  `incomplete` enum('true','false') DEFAULT 'false',
  `issueBy` varchar(50) DEFAULT NULL,
  `biometricLnk` varchar(255) DEFAULT NULL,
  `digitalSign` varchar(50) DEFAULT NULL,
  `workPhone` varchar(50) DEFAULT NULL,
  `neighborhood` varchar(50) DEFAULT NULL,
  `residency` varchar(250) DEFAULT NULL,
  `addrLine1_alt` varchar(200) DEFAULT NULL,
  `addrLine2_alt` varchar(200) DEFAULT NULL,
  `city_alt` varchar(50) DEFAULT NULL,
  `zip_alt` varchar(20) DEFAULT NULL,
  `state_alt` char(2) DEFAULT NULL,
  `country_alt` varchar(25) DEFAULT NULL,
  `neighborhood_alt` varchar(50) DEFAULT NULL,
  `residency_alt` varchar(250) DEFAULT NULL,
  `addrExpiry_alt` datetime DEFAULT NULL,
  `program` varchar(200) DEFAULT NULL,
  `studies` varchar(200) DEFAULT NULL,
  `permanent` enum('true','false') DEFAULT 'true',
  `fulltime` enum('true','false') DEFAULT 'true',
  `identification` varchar(100) DEFAULT NULL,
  `pref_contact` varchar(200) DEFAULT NULL,  
  PRIMARY KEY  (`uid`),
  UNIQUE KEY `u_sysLibUsername` (`sysCode`,`libCode`,`username`),
  UNIQUE KEY `u_sysLibBarcode` (`sysCode`,`libCode`,`userbarcode`),
  UNIQUE KEY `u_sysLibSid` (`sysCode`,`libCode`,`sid`),
  KEY `i_lastname` (`lastname`),
  KEY `i_homeroom` (`homeroom`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_deweyDesc`
--

CREATE TABLE `opl_deweyDesc` (
  `dewey` decimal(6,3) NOT NULL default '0.000',
  `dewey_100` smallint(3) default '0',
  `dewey_10` smallint(3) default '0',
  `dewey_int` smallint(3) default NULL,
  `dewey_decimal` decimal(3,3) default NULL,
  `description` text,
  PRIMARY KEY  (`dewey`),
  KEY `dIndex` (`dewey_100`,`dewey_10`,`dewey_int`,`dewey_decimal`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_emailDetails`
--

CREATE TABLE `opl_emailDetails` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `eid` int(10) unsigned NOT NULL default '0',
  `eContent` text,
  `eBarcodes` text,
  `subject` varchar(255) default NULL,
  `eTxtContent` text default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_emailRequest`
--

CREATE TABLE `opl_emailRequest` (
  `eid` int(10) unsigned NOT NULL auto_increment,
  `email` varchar(255) default NULL,
  `uid` int(10) unsigned NOT NULL default '0',
  `sendDate` datetime default NULL,
  `status` enum('sent','waiting','rejected') NOT NULL default 'waiting',
  `retryCount` tinyint(5) unsigned NOT NULL default '0',
  `requestDate` datetime default NULL,
  `reqType` enum('odNotice','preDueNotice') default 'odnotice',
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`eid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_extDatabase`
--

CREATE TABLE `opl_extDatabase` (
  `id` tinyint(3) unsigned NOT NULL auto_increment,
  `page` varchar(100) DEFAULT 'searchPage',
  `name` varchar(50) NOT NULL default '---',
  `url` text NOT NULL,
  `param` varchar(50) NOT NULL default '',
  `rank` tinyint(3) unsigned default '0',
  `hidden` tinyint(3) unsigned default '0',
  `description` text,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_file`
--

CREATE TABLE `opl_file` (
  `fileType` enum('image','audio') NOT NULL default 'image',
  `fileName` varchar(255) NOT NULL default '',
  `fRealName` varchar(255) default NULL,
  `mimeType` varchar(255) NOT NULL default '',
  `defaultMimeType` varchar(255) NOT NULL default '',
  `fileData` mediumblob NOT NULL,
  `defaultFile` mediumblob NOT NULL,
  PRIMARY KEY  (`fileType`,`fileName`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_fineMaterials`
--

CREATE TABLE `opl_fineMaterials` (
  `id` tinyint(3) unsigned NOT NULL auto_increment,
  `material` varchar(128) default 'book',
  `def` enum('0','1') default '0',
  PRIMARY KEY  (`id`),
  KEY `material` (`material`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_fineRate`
--

CREATE TABLE `opl_fineRate` (
  `id` tinyint(3) unsigned NOT NULL auto_increment,
  `itemType` varchar(100) default '0',
  `overdue` float(10,2) default '0.00',
  `overduePerHour` float(10,2) default '0.00',
  `maxOverdue` float(10,2) default '0.00',
  `damage` float(10,2) default '0.00',
  `toDel` tinyint(3) unsigned default '0',
  `itemCategory` enum('1','2','3') NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_found`
--

CREATE TABLE `opl_found` (
  `barcode` varchar(50) NOT NULL default '',
  `ondate` datetime default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_fullMarcRecord`
--

CREATE TABLE `opl_fullMarcRecord` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned default NULL,
  `tag_id` tinyint(3) unsigned default NULL,
  `tag` varchar(3) default NULL,
  `indicator1` char(1) default NULL,
  `indicator2` char(1) default NULL,
  `subfield` char(1) default NULL,
  `data` text,
  UNIQUE KEY `id` (`id`),
  KEY `id_2` (`id`,`rid`,`tag`,`tag_id`),
  FULLTEXT KEY `ftext` (`data`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_ge852record`
--

CREATE TABLE `opl_ge852record` (
  `req_id` int(10) unsigned default NULL,
  `rid` int(10) unsigned default NULL,
  `barcode` varchar(50) default NULL,
  `status` enum('waiting','done','read_permission_denied','write_permission_denied') NOT NULL default 'waiting',
  UNIQUE KEY `req_id` (`req_id`,`rid`,`barcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_ge852request`
--

CREATE TABLE `opl_ge852request` (
  `req_id` int(10) unsigned NOT NULL auto_increment,
  `bgJobId` int(10) unsigned DEFAULT NULL,
  `uid` int(10) unsigned default NULL,
  `o_code` char(1) default NULL,
  `n_code` char(1) default NULL,
  `o_data` varchar(255) default NULL,
  `n_data` varchar(255) default NULL,
  `newRecType` enum('book','bookManuscript','ebook','journal','serial','electronicMedia','internet','compactDisc','map','mapManuscript','bookOnTape','musicCassette','CDMusic','manuscriptMusic','sheetMusic','artifact','photoPoster','libraryKit','mixedMaterial','movie','videocassette','DVD','blu_ray') default NULL,
  `action` enum('update','append','appendF','delete','copy','transfer','updateAddNew','changeRecType','moveHolding') default NULL,
  `frDate` datetime default NULL,
  `toDate` datetime default NULL,
  `reqDate` datetime default NULL,
  `finishDate` datetime default NULL,
  `status` enum('waiting','processing','done') NOT NULL default 'waiting',
  `digest` varchar(128) NOT NULL default '',
  `tag` char(3) default NULL,
  PRIMARY KEY  (`req_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_guardian`
--

CREATE TABLE `opl_guardian` (
  `gid` int(10) unsigned NOT NULL auto_increment,
  `gtitle` varchar(5) default NULL,
  `gfirstname` varchar(50) default NULL,
  `glastname` varchar(50) default NULL,
  `gaddrLine1` varchar(80) default NULL,
  `gaddrLine2` varchar(80) default NULL,
  `gcity` varchar(50) default NULL,
  `gzip` varchar(20) default NULL,
  `gstate` char(2) default NULL,
  `gcountry` varchar(25) DEFAULT NULL ,
  `role` varchar(25) DEFAULT NULL,
  `gphone` varchar(50) default NULL,
  `gcellphone` varchar(50) default NULL,
  `gfax` varchar(50) default NULL,
  `gemail` varchar(60) default NULL,
  `uid` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`gid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_historyItem`
--

CREATE TABLE `opl_historyItem` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `barcode` varchar(15) NOT NULL default '',
  `ondate` datetime default NULL,
  `status` set('imported','deleted','damaged','lost','found') default NULL,
  `note` varchar(60) default NULL,
  PRIMARY KEY  (`id`),
  KEY `id` (`id`,`barcode`,`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_historyUser`
--

CREATE TABLE `opl_historyUser` (
  `id` int(3) unsigned NOT NULL auto_increment,
  `uid` int(10) unsigned default '0',
  `ondate` date default NULL,
  `status` set('added','deleted','modified','activated','deactivated','suspended') default NULL,
  `note` varchar(60) default NULL,
  PRIMARY KEY  (`id`),
  KEY `id` (`id`,`uid`,`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_hold`
--

CREATE TABLE `opl_hold` (
  `idReserve` int(10) unsigned NOT NULL default '0',
  `idHold` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `idloan` int(10) unsigned default '0',
  `barcode` varchar(50) NOT NULL default '',
  `dateHold` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateLoan` datetime default NULL,
  `dateCancel` datetime default NULL,
  PRIMARY KEY (`idHold`),
  KEY `i_hold` (`idReserve`,`barcode`,`dateLoan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_idGen`
--

CREATE TABLE `opl_idGen` (
  `type` varchar(255) NOT NULL default '0',
  `id` int(10) NOT NULL auto_increment,
  `checkSum` char(40) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

---- Table structure for table `opl_illAdmin`
--

CREATE TABLE `opl_illAdmin` (
  `uid` int(10) unsigned NOT NULL default '0',
  `sid` int(10) unsigned default NULL,
  `lid` int(10) unsigned default NULL,
  `adminType` tinyint(3) unsigned NOT NULL default '0',
  UNIQUE KEY `u_usl` (`uid`,`sid`,`lid`),
  KEY `i_sid` (`sid`),
  KEY `i_lid` (`lid`),
  KEY `i_uidType` (`uid`,`adminType`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_illNote`
--

CREATE TABLE `opl_illNote` (
  `illId` int(10) unsigned NOT NULL default '0',
  `sid` int(10) unsigned default NULL,
  `lid` int(10) unsigned default NULL,
  `uid` int(10) unsigned NOT NULL default '0',
  `notePublic` text,
  `notePrivate` text,
  `dateNote` datetime default NULL,
  KEY `i_illId` (`illId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_illReply`
--

CREATE TABLE `opl_illReply` (
  `illId` int(10) unsigned NOT NULL default '0',
  `sid` int(10) unsigned NOT NULL default '0',
  `lid` int(10) unsigned NOT NULL default '0',
  `uid` int(10) unsigned default NULL,
  `dateFill` datetime default NULL,
  `dateDue` datetime default NULL,
  `dateReturn` datetime default NULL,
  `dateReject` datetime default NULL,
  UNIQUE KEY `u_reply` (`illId`,`sid`,`lid`),
  KEY `i_illId` (`illId`),
  KEY `i_sid` (`sid`),
  KEY `i_lid` (`lid`),
  KEY `i_uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_illRequest`
--

CREATE TABLE `opl_illRequest` (
  `illId` int(10) unsigned NOT NULL auto_increment,
  `sid` int(10) unsigned NOT NULL default '0',
  `lid` int(10) unsigned NOT NULL default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `rid` int(10) unsigned NOT NULL default '0',
  `description` text,
  `dateRequest` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateReturn` datetime default NULL,
  `dateCancel` datetime default NULL,
  `dateExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`illId`),
  UNIQUE KEY `u_request` (`uid`,`dateRequest`),
  KEY `i_sid` (`sid`),
  KEY `i_lid` (`lid`),
  KEY `i_uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_illUser`
--

CREATE TABLE `opl_illUser` (
  `uid` int(10) unsigned NOT NULL default '0',
  `sid` int(10) unsigned NOT NULL default '0',
  `lid` int(10) unsigned NOT NULL default '0',
  `illPlace` tinyint(3) unsigned NOT NULL default '0',
  `illFill` tinyint(3) unsigned NOT NULL default '0',
  UNIQUE KEY `u_usl` (`uid`,`sid`,`lid`),
  KEY `i_illPlace` (`uid`,`illPlace`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_index_map`
--

CREATE TABLE `opl_index_map` (
  `attrVal` varchar(8) default NULL,
  `attrName` varchar(128) default NULL,
  `tag` char(3) default NULL,
  `subfields` varchar(32) default NULL,
  `attrList` varchar(255) default NULL,
  KEY `attribute` (`attrVal`,`attrName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_inventory`
--

CREATE TABLE `opl_inventory` (
  `invId` int(10) unsigned NOT NULL default '0',
  `fid` int(10) unsigned NOT NULL default '0',
  `scanOrder` int(10) unsigned NOT NULL auto_increment,
  `sortOrder` int(10) NOT NULL default '0',
  `callNumber` varchar(40) NOT NULL default '',
  `callNumberSort` varchar(100) DEFAULT NULL,
  `barcode` varchar(50) NOT NULL default '',
  `status` set('active','damaged','found','missing','loan','invalid','unknown','noCallNumber','scanned','misplace','excluded') NOT NULL default 'active',
  `updated` tinyint(3) unsigned NOT NULL default '0',
  `updatedStatus` set('active','damaged','found','missing','loan','invalid','unknown','noCallNumber','scanned','misplace','excluded') NOT NULL default '',
  `noteDetail` varchar(100) default NULL,
  PRIMARY KEY  (`scanOrder`),
  UNIQUE KEY `bc_invId` (`barcode`,`invId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_inventoryFile`
--

CREATE TABLE `opl_inventoryFile` (
  `invId` int(10) unsigned NOT NULL default '0',
  `fid` int(10) unsigned NOT NULL auto_increment,
  `fname` varchar(255) NOT NULL default '',
  `uid` int(10) unsigned NOT NULL default '0',
  `mesgDigest` varchar(128) default NULL,
  `dateUpload` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`fid`),
  UNIQUE KEY `u_fileUser` (`fname`,`uid`,`invId`),
  UNIQUE KEY `u_mesgDigest` (`mesgDigest`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_inventoryInfo`
--

CREATE TABLE `opl_inventoryInfo` (
  `invId` int(10) NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `callNoB` varchar(40) default '0',
  `callNoE` varchar(40) default '0',
  `invDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `status` set('scanning','done','waiting','processing','closed') default 'scanning',
  `orderidB` int(5) unsigned default NULL,
  `orderidE` int(5) unsigned default NULL,
  `invRecType` set('book','bookManuscript','ebook','journal','serial','electronicMedia','internet','compactDisc','map','mapManuscript','bookOnTape','musicCassette','CDMusic','manuscriptMusic','sheetMusic','artifact','photoPoster','libraryKit','mixedMaterial','movie','videocassette','DVD','blu_ray') DEFAULT 'book',
  `invItemType` text,  
  PRIMARY KEY  (`invId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_inventoryResult`
--

CREATE TABLE `opl_inventoryResult` (
  `invId` int(10) unsigned NOT NULL default '0',
  `varName` varchar(255) default NULL,
  `varValue` varchar(255) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_item`
--

CREATE TABLE `opl_item` (
  `barcode` varchar(50) NOT NULL default '',
  `rid` int(10) unsigned NOT NULL default '0',
  `available` tinyint(4) default '1',
  `typeId` varchar(100) NOT NULL default '',
  `callNumber` varchar(40) default NULL,
  `dateImport` datetime default NULL,
  `price` varchar(50) default NULL,
  `location` varchar(100) default NULL,
  `importId` int(10) unsigned NOT NULL default '0',
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `callNumSort_dewey` varchar(100) DEFAULT '',
  `callNumSort_lcc` varchar(100) DEFAULT '',
  `circStats` text,
  PRIMARY KEY  (`barcode`),
  KEY `i_rid` (`rid`),
  KEY `i_location` (`location`),
  KEY `i_callNumber` (`callNumber`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_itemCategory`
--

CREATE TABLE `opl_itemCategory` (
  `id` int(10) NOT NULL auto_increment,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_itemInfo`
--

CREATE TABLE `opl_itemInfo` (
  `barcode` varchar(50) NOT NULL default '',
  `sf852Code` char(1) NOT NULL default '',
  `sf852Data` varchar(255) NOT NULL default '',
  UNIQUE KEY `u_bcd` (`barcode`,`sf852Code`,`sf852Data`),
  KEY `i_cd` (`sf852Code`,`sf852Data`),
  FULLTEXT KEY `f_sf852Data` (`sf852Data`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_itemStats`
--
CREATE TABLE `opl_itemStats` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `statId` int(10) unsigned default NULL,
  `rid` int(10) unsigned NOT NULL default '1',
  `barcode` varchar(50) NOT NULL default '',
  `prefix` varchar(16) default NULL,
  `import` int(5) unsigned NOT NULL default '0',
  `deleted` int(5) unsigned NOT NULL default '0',
  `lost` int(5) unsigned NOT NULL default '0',
  `damaged` int(5) unsigned NOT NULL default '0',
  `missing` int(5) unsigned NOT NULL default '0',
  `found` int(5) unsigned NOT NULL default '0',
  `validStats` enum('yes','no') default 'yes',
  PRIMARY KEY  (`id`),
  KEY `prefix` (`prefix`),
  KEY `status` (`import`,`deleted`,`lost`,`damaged`,`missing`,`found`),
  KEY `import` (`import`),
  KEY `deleted` (`deleted`),
  KEY `lost` (`lost`),
  KEY `rid` (`rid`,`statId`),
  KEY `barcode` (`barcode`),
  KEY `validRow` (`validStats`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

--
-- Table structure for table `opl_itemType`
--

CREATE TABLE `opl_itemType` (
  `id` varchar(100) NOT NULL default '',
  `description` text,
  `defaultType` tinyint(3) unsigned default '0',
  `itemCategory` enum('1','2','3') NOT NULL default '1',
  `timeOnShelvingCart` int(5) unsigned DEFAULT '0',
  PRIMARY KEY  (`id`,`itemCategory`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_itemTypeChange`
--

CREATE TABLE `opl_itemTypeChange` (
  `cid` int(10) unsigned NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `dateRequest` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateFinish` datetime default NULL,
  `oldTypeId` varchar(100) NOT NULL default '',
  `newTypeId` varchar(100) NOT NULL default '',
  `cReplaced` int(10) unsigned default '0',
  `cTotal` int(10) unsigned NOT NULL default '0',
  `status` enum('waiting','invalid','processing','done') NOT NULL default 'waiting',
  PRIMARY KEY  (`cid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_itemTypeParam`
--

CREATE TABLE `opl_itemTypeParam` (
  `itemTypeId` varchar(100) NOT NULL default '',
  `userTypeId` int(10) unsigned NOT NULL default '0',
  `loanPeriod` int(10) unsigned NOT NULL default '0',
  `renewalPeriod` int(10) unsigned NOT NULL default '0',
  `reservePeriod` int(10) unsigned NOT NULL default '0',
  `holdPeriod` int(10) unsigned NOT NULL default '0',
  `gracePeriod` int(10) unsigned NOT NULL default '0',
  `gracePeriodUnit` enum('hour','minute') default 'hour',
  `maxRenewal` tinyint(3) unsigned default '0',
  `maxItemLoan` tinyint(3) unsigned DEFAULT '0',
  `fine` float NOT NULL default '0',
  PRIMARY KEY  (`itemTypeId`,`userTypeId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_itemstatus`
--

CREATE TABLE `opl_itemstatus` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `barcode` varchar(50) NOT NULL default '',
  `ondate` datetime default NULL,
  `status` tinyint(4) default '0',
  `note` varchar(60) default NULL,
  PRIMARY KEY  (`id`),
  KEY `index1` (`barcode`,`ondate`,`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_libSystem`
--

CREATE TABLE `opl_libSystem` (
  `sid` int(10) unsigned NOT NULL auto_increment,
  `sCode` varchar(10) NOT NULL default '',
  `sName` text NOT NULL,
  `sAddrLine1` varchar(255) default NULL,
  `sAddrLine2` varchar(255) default NULL,
  `sCity` varchar(255) default NULL,
  `sState` varchar(10) default NULL,
  `sZip` varchar(10) default NULL,
  `sPhone` varchar(50) default NULL,
  `sFax` varchar(50) default NULL,
  `sContact` varchar(255) default NULL,
  `sEmail` varchar(255) default NULL,
  PRIMARY KEY  (`sid`),
  UNIQUE KEY `u_sCode` (`sCode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_lcc`
--


CREATE TABLE `opl_lcc` (
  `id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
  `lccGrp` varchar(30) DEFAULT '',
  `sbjClass` varchar(5) NOT NULL DEFAULT '',
  `sbjRange` varchar(100) NOT NULL DEFAULT '',
  `rangeB` float DEFAULT '0',
  `rangeE` float DEFAULT '0',
  `description` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `i_groupRange` (`sbjClass`,`sbjRange`),
  KEY `i_desc` (`description`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;

--
-- Table structure for table `opl_library`
--

CREATE TABLE `opl_library` (
  `lid` int(10) unsigned NOT NULL auto_increment,
  `sysCode` varchar(10) NOT NULL default '',
  `lCode` varchar(10) NOT NULL default '',
  `lName` text NOT NULL,
  `lAddrLine1` varchar(255) default NULL,
  `lAddrLine2` varchar(255) default NULL,
  `lCity` varchar(255) default NULL,
  `lState` varchar(10) default NULL,
  `lZip` varchar(10) default NULL,
  `lPhone` varchar(50) default NULL,
  `lFax` varchar(50) default NULL,
  `lContact` varchar(255) default NULL,
  `lEmail` varchar(255) default NULL,
  PRIMARY KEY  (`lid`),
  UNIQUE KEY `u_sysLib` (`sysCode`,`lCode`),
  KEY `i_lCode` (`lCode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_loan`
--

CREATE TABLE `opl_loan` (
  `idloan` int(10) unsigned NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `barcode` varchar(50) NOT NULL default '',
  `maxRenewal` tinyint(3) unsigned default '0',
  `dateLoan` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateDue` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateRenewal` datetime default NULL,
  `dateReturn` datetime default NULL,
  `renewalCount` tinyint(4) default '0',
  `finerate` float NOT NULL default '0',
  `status` tinyint(4) default '0',
  `type` varchar(50) default NULL,
  `timeOnShelvingCart` int(5) unsigned DEFAULT '0' ,
  PRIMARY KEY  (`idloan`),
  UNIQUE KEY `u_bcdl` (`barcode`,`dateLoan`),
  KEY `i_loan` (`uid`,`barcode`,`dateLoan`),
  KEY `i_barcode` (`barcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_lost`
--

CREATE TABLE `opl_lost` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `price` float default '0',
  `orderfee` float default '0',
  `shipfee` float default '0',
  `fdrtax` float default '0',
  `prvtax` float default '0',
  `amount` float default '0',
  `ondate` datetime default NULL,
  `final` char(1) default '0',
  `idloan` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_marcDelete`
--

CREATE TABLE `opl_marcDelete` (
  `idmarc` int(11) NOT NULL auto_increment,
  `tsDeletion` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `content` mediumtext,
  PRIMARY KEY  (`idmarc`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_marcDuplicate`
--

CREATE TABLE `opl_marcDuplicate` (
  `mid` int(10) unsigned NOT NULL auto_increment,
  `iid` int(10) unsigned NOT NULL default '0',
  `content` mediumtext,
  PRIMARY KEY  (`mid`),
  KEY `i_iid` (`iid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_marcExport`
--

CREATE TABLE `opl_marcExport` (
  `eid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `dateRequest` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `eType` enum('date','rid','all','modDate_r','modDate_h','ridList_r','ridList_h','hitlist') DEFAULT NULL,
  `eFrom` varchar(50) NOT NULL DEFAULT '',
  `eTo` varchar(50) NOT NULL DEFAULT '',
  `eEncoding` enum('UTF-8','MARC-8') NOT NULL DEFAULT 'UTF-8',
  `exclRecFormat` text,
  `dateExpiry` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `dateFinish` datetime DEFAULT NULL,
  `cRecord` int(10) unsigned DEFAULT NULL,
  `cHolding` int(10) unsigned DEFAULT NULL,
  `cFixedRec` int(10) unsigned DEFAULT NULL,
  `status` enum('waiting','processing','ready') NOT NULL DEFAULT 'waiting',
  `ridList` text,
  PRIMARY KEY (`eid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_marcImport`
--

CREATE TABLE `opl_marcImport` (
  `iid` int(10) unsigned NOT NULL auto_increment,
  `sid` int(10) unsigned default '0',
  `lid` int(10) unsigned default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `encoding` enum('UTF-8','MARC-8') NOT NULL default 'UTF-8',
  `sf852Code` char(1) default NULL,
  `sf852Data` varchar(255) default NULL,
  `sf856Code` char(1) DEFAULT '',
  `sf856Data` varchar(255) DEFAULT '',
  `type` enum('hardCopy','ebook') DEFAULT 'hardCopy',
  `mode` enum('autoMerge','overlay','manualMerge','new') NOT NULL default 'autoMerge',
  `mergeMode` enum('strict','loose','re-import') NOT NULL default 'strict',
  `countImported` int(10) unsigned default '0',
  `countMerged` int(10) unsigned default '0',
  `countMergedHolding` int(10) unsigned default '0',
  `countProcessed` int(10) unsigned default '0',
  `countTotal` int(10) unsigned NOT NULL default '0',
  `dateImport` datetime default NULL,
  `dateUpload` datetime NOT NULL default '0000-00-00 00:00:00',
  `mesgDigest` varchar(128) default '',
  `status` enum('uploaded','rejected','accepted','indexing','done') NOT NULL default 'uploaded',
  `addToNewItemList` tinyint(1) unsigned default '0',
  `newItemExpDate` datetime default NULL,
  `holding_op` enum('update','preserve') NOT NULL default 'update',
  `recordSource` enum('generic','OCoLC') NOT NULL default 'generic',
  PRIMARY KEY  (`iid`),
  KEY `i_uid` (`uid`),
  KEY `i_lid` (`lid`),
  KEY `i_mesgDigest` (`mesgDigest`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_marcRecord`
--

CREATE TABLE `opl_marcRecord` (
  `rid` int(10) unsigned NOT NULL default '1',
  `title` text,
  `titleSort` varchar(255) default NULL,
  `author` text,
  `pubPlace` varchar(60) default NULL,
  `pubName` varchar(60) default NULL,
  `pubDate` varchar(20) default NULL,
  `pubDateSort` varchar(100) default NULL,
  `isbn` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zIndexed` tinyint(4) NOT NULL default '0',
  `lockExpire` datetime default NULL,
  `editUid` int(10) unsigned default NULL,
  `sessionid` varchar(40) default NULL,
  `leader` varchar(24) default NULL,
  `cf_008` varchar(40) default NULL,
  `modDate` datetime default '0000-00-00 00:00:00',
  `print` set('print','fiction','nonFiction','pro','ref','serial','shortStories') default NULL,
  `nonPrint` set('nonPrint','video','audio','multiMedia','cassette','kit','mixedMaterial','notatedMusic','map') default NULL,
  `deleted` tinyint(3) unsigned default '0',
  `incomplete` enum('true','false') default 'false',
  `tempIll` enum('temporary','ILL') default NULL,
  `recFormat` set('book','bookManuscript','ebook','journal','serial','electronicMedia','internet','compactDisc','map','mapManuscript','bookOnTape','musicCassette','CDMusic','manuscriptMusic','sheetMusic','artifact','photoPoster','libraryKit','mixedMaterial','movie','videocassette','DVD','blu_ray','pdf') default 'book',
  `literaryForm` varchar(100) default 'unknown',
  PRIMARY KEY  (`rid`),
  KEY `index1` (`leader`,`cf_008`,`modDate`),
  KEY `ind_titlesort` (`titleSort`),
  KEY `ind_pub` (`pubPlace`,`pubName`,`pubDate`,`pubDateSort`),
  KEY `ind_isbn` (`isbn`),
  FULLTEXT KEY `ind_auth` (`author`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_menuItem`
--

CREATE TABLE `opl_menuItem` (
  `MENU_ITEM_ID` bigint(20) NOT NULL auto_increment,
  `PARENT_ID` bigint(20) default NULL,
  `headerKey` varchar(255) default NULL,
  `orderValue` int(11) default NULL,
  `color` varchar(255) default NULL,
  `language` varchar(8) default 'en',
  `title` varchar(255) default NULL,
  `isJava` bit(1) default NULL,
  `path` varchar(255) default NULL,
  `permission` varchar(50) default NULL,
  `permissions` varchar(255) default '',
  PRIMARY KEY  (`MENU_ITEM_ID`),
  KEY `FK4CD5A1F36DE0266` (`PARENT_ID`),
  CONSTRAINT `FK4CD5A1F36DE0266` FOREIGN KEY (`PARENT_ID`) REFERENCES `opl_menuItem` (`MENU_ITEM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_newsEvents`
--

CREATE TABLE `opl_newsEvents` (
  `idNE` mediumint(3) unsigned NOT NULL auto_increment,
  `title` varchar(254) default NULL,
  `description` text,
  `expDate` date default NULL,
  `status` enum('on','off') default 'on',
  PRIMARY KEY  (`idNE`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_nystd`
--

CREATE TABLE `opl_nystd` (
  `NY_ID` varchar(20) default NULL,
  `grade` varchar(5) default NULL,
  `level` varchar(50) default NULL,
  `category` varchar(150) default NULL,
  `subject` varchar(150) default NULL,
  `NY_Std_No` int(3) unsigned default '0',
  `NY_Bmrk_No` int(3) unsigned default '0',
  `NYStandard` text,
  `NYBmrk` text,
  `subjectStandard` varchar(254) default NULL,
  `cerfcode` text,
  `subjectAlphabet` char(1) default NULL,
  FULLTEXT KEY `NYstandard` (`NYStandard`,`subjectStandard`,`NYBmrk`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_odl`
--

CREATE TABLE `opl_odl` (
  `odl_id` int(10) unsigned NOT NULL auto_increment,
  `responsible` int(10) unsigned DEFAULT NULL,
  `idloan` int(10) unsigned default '0',
  `type` set('overdue','lost','damaged','claimNeverLoaned','claimReturned') default 'overdue',
  `days_overdue` tinyint(3) unsigned default '0',
  `hours_overdue` tinyint(3) unsigned default '0',
  `ondate` datetime NOT NULL default '0000-00-00 00:00:00',
  `settleDate` datetime default NULL,
  `note` text,
  PRIMARY KEY  (`odl_id`),
  KEY `NewIndex` (`odl_id`,`idloan`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_offlineLoan`
--

CREATE TABLE `opl_offlineLoan` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `idloan` int(10) unsigned default NULL,
  `itemBC` varchar(50) default NULL,
  `userBC` varchar(50) default NULL,
  `transDate` datetime default NULL,
  `note` text,
  `status` smallint(5) unsigned default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_openHours`
--

CREATE TABLE `opl_openHours` (
  `id` tinyint(3) unsigned NOT NULL auto_increment,
  `weekday` tinyint(3) unsigned default '0',
  `open` varchar(32) default NULL,
  `close` varchar(32) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_overdue`
--

CREATE TABLE `opl_overdue` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `idloan` int(10) unsigned NOT NULL default '0',
  `ondate` datetime NOT NULL default '0000-00-00 00:00:00',
  `amount` float NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_payRefundInfo`
--

CREATE TABLE `opl_payRefundInfo` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `tid` int(10) unsigned default NULL,
  `paid_tid` int(10) unsigned default NULL,
  `note` varchar(60) default NULL,
  `date` datetime default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_payment`
--

CREATE TABLE `opl_payment` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `amount` float default '0',
  `ondate` datetime default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_permGroup`
--

CREATE TABLE `opl_permGroup` (
  `id` int(10) NOT NULL auto_increment,
  `ssId` int(10) NOT NULL,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_permission`
--

CREATE TABLE `opl_permission` (
  `id` int(10) NOT NULL auto_increment,
  `grpId` int(10) NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(50) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--

-- Table structure for table `opl_prefFormParam`
--

CREATE TABLE `opl_prefFormParam` (
  `var` varchar(150) NOT NULL,
  `listOrder` tinyint(2) unsigned default '0',
  `name` varchar(150) NOT NULL,
  `val` varchar(150) NOT NULL,
  UNIQUE KEY `var` (`var`,`val`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_prefGroup`
--

CREATE TABLE `opl_prefGroup` (
  `id` int(10) default '0',
  `title` varchar(128) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_preference`
--

CREATE TABLE `opl_preference` (
  `var` varchar(25) NOT NULL default '',
  `val` text,
  `valShow` text,
  `opt` varchar(10) default NULL,
  `varType` set('text','radio','checkbox','select','multipleSelect','timeLength') default 'text',
  `description` text,
  `hidden` tinyint(3) unsigned default '0',
  `gid` int(10) unsigned default NULL,
  `gOrder` int(10) unsigned default NULL,
  PRIMARY KEY  (`var`),
  KEY `i_hidden` (`hidden`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

--
-- Table structure for table `opl_recordArchive`
--

CREATE TABLE `opl_recordArchive` (
  `archId` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '1',
  `onDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `marcXml` mediumblob,
  PRIMARY KEY  (`archId`),
  KEY `rid` (`rid`,`onDate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_recordIdentifier`
--

CREATE TABLE `opl_recordIdentifier` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '1',
  `tag` char(3) NOT NULL default '',
  `code` char(1) NOT NULL default '',
  `data` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
  KEY `i_tcd` (`tag`,`code`,`data`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

--
-- Table structure for table `opl_recordStats`
--
CREATE TABLE `opl_recordStats` (
  `statId` int(10) unsigned NOT NULL auto_increment,
  `archId` int(10) unsigned default NULL,
  `rid` int(10) unsigned NOT NULL default '1',
  `onDate` datetime default NULL,
  `status` enum('new','deleted','changed') default 'new',
  PRIMARY KEY  (`statId`),
  KEY `archId` (`archId`,`rid`,`onDate`,`status`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;


--
-- Table structure for table `opl_recordindex`
--

CREATE TABLE `opl_recordindex` (
  `rid` int(10) unsigned NOT NULL,
  `attr_1003` text,
  `attr_1018` text,
  `attr_12` text,
  `attr_13` text,
  `attr_16` text,
  `attr_21` text,
  `attr_31` text,
  `attr_4` text,
  `attr_5` text,
  `attr_5000` text,
  `attr_5001` text,
  `attr_5002` text,
  `attr_59` text,
  `attr_6` text,
  `attr_63` text,
  `attr_7` text,
  `attr_8` text,
  `attr_9` text,
  `attr_s1003` text,
  `attr_s31` text,
  `attr_s4` text,
  `attr_s5001` text,
  PRIMARY KEY  (`rid`),
  FULLTEXT KEY `index_a1003` (`attr_1003`),
  FULLTEXT KEY `index_a1016` (`attr_4`,`attr_5`,`attr_6`,`attr_21`,`attr_31`,`attr_59`,`attr_63`,`attr_1003`),
  FULLTEXT KEY `index_a1018` (`attr_1018`),
  FULLTEXT KEY `index_a12` (`attr_12`),
  FULLTEXT KEY `index_a13` (`attr_13`),
  FULLTEXT KEY `index_a16` (`attr_16`),
  FULLTEXT KEY `index_a21` (`attr_21`),
  FULLTEXT KEY `index_a31` (`attr_31`),
  FULLTEXT KEY `index_a4` (`attr_4`),
  FULLTEXT KEY `index_a5` (`attr_5`),
  FULLTEXT KEY `index_a5000` (`attr_5000`),
  FULLTEXT KEY `index_a5001` (`attr_5001`),
  FULLTEXT KEY `index_a5002` (`attr_5002`),
  FULLTEXT KEY `index_a59` (`attr_59`),
  FULLTEXT KEY `index_a6` (`attr_6`),
  FULLTEXT KEY `index_a63` (`attr_63`),
  FULLTEXT KEY `index_a7` (`attr_7`),
  FULLTEXT KEY `index_a8` (`attr_8`),
  FULLTEXT KEY `index_a9` (`attr_9`),
  FULLTEXT KEY `index_as1003` (`attr_s1003`),
  FULLTEXT KEY `index_as31` (`attr_s31`),
  FULLTEXT KEY `index_as4` (`attr_s4`),
  FULLTEXT KEY `index_as5001` (`attr_s5001`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_reserve`
--

CREATE TABLE `opl_reserve` (
  `idReserve` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `priority` int(6) unsigned DEFAULT '1000',
  `numCopyReserve` tinyint(4) default '1',
  `dateReserve` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateCancel` datetime default NULL,
  `suspendFrom` datetime DEFAULT NULL , 
  `suspendUntil` datetime DEFAULT NULL,
  PRIMARY KEY  (`idReserve`),
  KEY `i_reserve` (`rid`,`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `opl_requestReserve`
--

CREATE TABLE `opl_requestReserve` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `numCopyRequest` tinyint(4) DEFAULT '1',
  `idReserve` int(10) unsigned DEFAULT NULL,
  `rid` int(10) unsigned NOT NULL DEFAULT '0',
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `email` varchar(60) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `dateRequest` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `dateExpiry` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `dateProcess` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` enum('cancel','ready','reject','reserve','hold','waiting') DEFAULT 'waiting',
  `noticeType` varchar(60) DEFAULT 'phone',
  PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_reqReserveHistory`
--

CREATE TABLE `opl_reqReserveHistory` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reqId` int(10) unsigned NOT NULL,
  `uid` int(10) unsigned NOT NULL,
  `dateLog` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `action` varchar(100) DEFAULT NULL,
  `log` text,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_ridBcdHitlistExport`
--

CREATE TABLE `opl_ridBcdHitlistExport` (
  `eid` int(10) unsigned default '0',
  `rid` int(10) unsigned default '0',
  `barcode` varchar(50) default '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_schoolYear`
--

CREATE TABLE `opl_schoolYear` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `schoolYear` varchar(45) NOT NULL,
  `firstDate` datetime default NULL,
  `lastDate` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `Index_2` (`firstDate`,`lastDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_session`
--

CREATE TABLE `opl_session` (
  `sessionid` varchar(40) NOT NULL default '',
  `uid` int(10) unsigned NOT NULL default '0',
  `ipaddress` varchar(63) default NULL,
  `lasttime` datetime default NULL,
  PRIMARY KEY  (`sessionid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_sessionVar`
--

CREATE TABLE `opl_sessionVar` (
  `ssid` varchar(40) default '0',
  `var` varchar(36) default NULL,
  `sOrder` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned default NULL,
  `barcode` varchar(50) default NULL,
  `note` text,
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  UNIQUE KEY `u_svo` (`ssid`,`var`,`sOrder`),
  KEY `rid` (`rid`,`barcode`,`var`,`ssid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_studentILL`
--

CREATE TABLE `opl_studentILL` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `zid` tinyint(3) unsigned NOT NULL default '0',
  `rid` int(10) unsigned default NULL,
  `title` text,
  `author` text,
  `pubDate` varchar(20) NOT NULL default '',
  `description` text,
  `dRequest` datetime NOT NULL default '0000-00-00 00:00:00',
  `dExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `dApproval` datetime default NULL,
  `dRejection` datetime default NULL,
  `responderList` varchar(255) NOT NULL default '',
  `illAdmin` int(10) unsigned NOT NULL default '0',
  `illID` int(10) unsigned NOT NULL default '0',
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_subSystem`
--

CREATE TABLE `opl_subSystem` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_subjects`
--

CREATE TABLE `opl_subjects` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `subject` text,
  `recCount` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `subject` (`subject`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_taxcalcdetail`
--

CREATE TABLE `opl_taxcalcdetail` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `tid` int(10) unsigned NOT NULL default '0',
  `taxName` varchar(64) NOT NULL default '0',
  `taxRate` float(10,2) NOT NULL default '0.00',
  `taxBase` set('basic','taxontax') NOT NULL default 'basic',
  `taxableAmount` float(10,2) NOT NULL default '0.00',
  `tax` float(10,2) NOT NULL default '0.00',
  PRIMARY KEY  (`id`),
  KEY `NewIndex` (`tid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_taxes`
--

CREATE TABLE `opl_taxes` (
  `id` tinyint(3) unsigned NOT NULL auto_increment,
  `taxName` varchar(64) default '0',
  `rate` float(10,2) default '0.00',
  `type` set('flat','%') default '%',
  `calFormat` set('basic','taxontax') default 'basic',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_teacherSchedule`
--

CREATE TABLE `opl_teacherSchedule` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `sectionId` varchar(45) default NULL,
  `courseId` int(8) unsigned default NULL,
  `courseCode` varchar(45) default NULL,
  `teacherId` varchar(45) default NULL,
  `createdDate` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `Index_2` (`sectionId`,`courseCode`,`teacherId`,`courseId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_template`
--

CREATE TABLE `opl_template` (
  `tid` tinyint(3) unsigned NOT NULL auto_increment,
  `rank` tinyint(3) unsigned NOT NULL default '1',
  `name` varchar(100) default NULL,
  `sysDefinedType` varchar(100) default NULL,
  `content` mediumtext,
  PRIMARY KEY  (`tid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_transCode`
--

CREATE TABLE `opl_transCode` (
  `code` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code_str` varchar(50) DEFAULT NULL,
  `name` varchar(150) NOT NULL,
  `note` varchar(255) NOT NULL,
  PRIMARY KEY (`code`),
  KEY `Index_2` (`name`)  
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


--
-- Table structure for table `opl_unionRequest`
--

CREATE TABLE `opl_unionRequest` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `uid` tinyint(10) unsigned default NULL,
  `reqType` set('deletion','import') default 'deletion',
  `date` datetime default NULL,
  `status` enum('creating','pending','processing','sent') default 'creating',
  `unionSvrRespErr` varchar(255) default NULL,
  PRIMARY KEY  (`id`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_unionRequestDetail`
--

CREATE TABLE `opl_unionRequestDetail` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `reqId` int(10) unsigned NOT NULL default '0',
  `rid` int(10) unsigned default '0',
  `barcode` varchar(50) default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_user`
--

CREATE TABLE `opl_user` (
  `sysCode` varchar(10)  DEFAULT NULL,
  `libCode` varchar(10)  DEFAULT NULL,
  `username` varchar(20) DEFAULT NULL,
  `password` varchar(86) DEFAULT NULL,
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sid` varchar(18) DEFAULT NULL,
  `employeeId` varchar(18) DEFAULT NULL, 
  `userbarcode` varchar(18) DEFAULT NULL,
  `SIF_refId` varchar(50) DEFAULT NULL,
  `title` varchar(5) DEFAULT NULL,
  `firstname` varchar(50) DEFAULT NULL,
  `lastname` varchar(50) DEFAULT NULL,
  `middlename` varchar(50) DEFAULT NULL,
  `fullname` text,
  `nickname` varchar(50) DEFAULT NULL,
  `addrLine1` varchar(80) DEFAULT NULL,
  `addrLine2` varchar(80) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `zip` varchar(20) DEFAULT NULL,
  `state` char(2) DEFAULT NULL,
  `country` varchar(25) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `cellphone` varchar(50) DEFAULT NULL,
  `fax` varchar(50) DEFAULT NULL,
  `email` varchar(60) DEFAULT NULL,
  `birthday` date DEFAULT NULL,
  `gender` tinyint(1) unsigned DEFAULT '0',
  `created` datetime DEFAULT NULL,
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `pw_timestamp` datetime DEFAULT NULL,
  `permission` varchar(50) DEFAULT NULL,
  `permissions` text,
  `expirydate` datetime DEFAULT NULL,
  `status` tinyint(1) unsigned DEFAULT '0',
  `categorycode` int(11) DEFAULT NULL,
  `district`  varchar(150) DEFAULT NULL,
  `schoolName`  varchar(200) DEFAULT NULL,
  `buildingcode` varchar(10)  DEFAULT '',
  `homeroom` varchar(100) DEFAULT '',
  `teacher` varchar(100) DEFAULT '',
  `grade` varchar(10)  DEFAULT '',
  `yeargraduation` smallint(5) unsigned DEFAULT '0',
  `notes` mediumtext,
  `designation` varchar(100) DEFAULT NULL,
  `privateNotes` mediumtext,
  `pref_lang` char(2) DEFAULT NULL,
  `pref_theme` varchar(50) DEFAULT NULL,
  `idimport` int(11) DEFAULT '0',
  `incomplete` enum('true','false') DEFAULT 'false',
  `issueBy` varchar(50) DEFAULT NULL,
  `biometricLnk` varchar(255) DEFAULT NULL,
  `digitalSign` varchar(50) DEFAULT NULL,
  `workPhone` varchar(50) DEFAULT NULL,
  `neighborhood` varchar(50) DEFAULT NULL,
  `residency` varchar(250) DEFAULT NULL,
  `addrLine1_alt` varchar(200) DEFAULT NULL,
  `addrLine2_alt` varchar(200) DEFAULT NULL,
  `city_alt` varchar(50) DEFAULT NULL,
  `zip_alt` varchar(20) DEFAULT NULL,
  `state_alt` char(2) DEFAULT NULL,
  `country_alt` varchar(25) DEFAULT NULL,
  `neighborhood_alt` varchar(50) DEFAULT NULL,
  `residency_alt` varchar(250) DEFAULT NULL,
  `addrExpiry_alt` datetime DEFAULT NULL,
  `program` varchar(200) DEFAULT NULL,
  `studies` varchar(200) DEFAULT NULL,
  `permanent` enum('true','false') DEFAULT 'true',
  `fulltime` enum('true','false') DEFAULT 'true',
  `identification` varchar(100) DEFAULT NULL,
  `pref_contact` varchar(200) DEFAULT NULL,
  `circStats` text ,
  `keepLoanHistory` tinyint(4) DEFAULT '1',
  `noticeByEmail` tinyint(4) DEFAULT '1',
   PRIMARY KEY  (`uid`),
  UNIQUE KEY `u_sysLibUsername` (`sysCode`,`libCode`,`username`),
  UNIQUE KEY `u_sysLibBarcode` (`sysCode`,`libCode`,`userbarcode`),
  UNIQUE KEY `u_sysLibSid` (`sysCode`,`libCode`,`sid`),
  KEY `i_lastname` (`lastname`),
  KEY `i_homeroom` (`homeroom`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_userImg`
--

CREATE TABLE `opl_userImg` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL,
  `userbarcode` varchar(18) default NULL,
  `orgFile` mediumblob,
  `thumbnail` mediumblob,
  `mimeType` varchar(255) default NULL,
  `fileName` varchar(255) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `u_user` (`uid`,`userbarcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_userimport`
--

CREATE TABLE `opl_userimport` (
  `idimport` int(10) unsigned NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `dateImport` datetime default NULL,
  `dateUpload` datetime NOT NULL default '0000-00-00 00:00:00',
  `data` mediumtext NOT NULL,
  `countProcessed` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`idimport`),
  KEY `i_uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_webLinks`
--

CREATE TABLE `opl_webLinks` (
  `title` varchar(254) default '0',
  `description` text,
  `url` varchar(254) default NULL,
  `subject` text,
  `grade` varchar(254) default 'All'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_zDatabase`
--

CREATE TABLE `opl_zDatabase` (
  `zid` tinyint(3) unsigned NOT NULL auto_increment,
  `host` varchar(255) NOT NULL default 'localhost',
  `port` smallint(5) unsigned NOT NULL default '210',
  `name` varchar(20) NOT NULL default 'default',
  `syntax` tinyint(3) unsigned NOT NULL default '0',
  `encoding` enum('marc8','utf8') NOT NULL default 'utf8',
  `username` varchar(20) default NULL,
  `password` varchar(20) default NULL,
  `description` varchar(255) NOT NULL default '',
  `state` tinyint(3) unsigned default '1',
  `stateList` tinyint(3) unsigned default '1',
  `filter` varchar(255) NOT NULL default '',
  `circData` tinyint(3) unsigned NOT NULL default '0',
  `studentILL` tinyint(3) unsigned NOT NULL default '0',
  `locationId` varchar(50) default NULL,
  PRIMARY KEY  (`zid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `opl_zResult`
--

CREATE TABLE `opl_zResult` (
  `uid` int(10) unsigned NOT NULL default '0',
  `resultId` int(10) unsigned NOT NULL default '0',
  `content` mediumtext,
  `holding` text,
  `syntax` varchar(10) default NULL,
  `encoding` enum('marc8','utf8') NOT NULL default 'utf8',
  KEY `i_zResult` (`resultId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



CREATE TABLE `pf_ridMap` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(10) unsigned NOT NULL DEFAULT '0',
  `pfId` int(10) unsigned NOT NULL,
  `modDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `notes` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_2` (`id`,`pfId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `pf_record`
--


CREATE TABLE `pf_record` (
  `pfId` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(255) default NULL,
  `author` varchar(255) default NULL,
  `authPosition` varchar(255) default NULL,
  `introduction` text,
  `subjectArea` varchar(255) default NULL,
  `createdDate` datetime default NULL,
  `expiryDate` datetime default NULL,
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `audience` varchar(255) character set latin1 default NULL,
  `xml` text,
  PRIMARY KEY  (`pfId`),
  UNIQUE KEY `rid` (`pfId`),
  KEY `i_title` (`pfId`,`title`,`createdDate`,`modDate`),
  KEY `i_subjectArea` (`pfId`,`subjectArea`,`createdDate`,`modDate`),
  FULLTEXT KEY `Index_4` (`title`,`introduction`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `pf_sbjAreaList`
--

CREATE TABLE `pf_sbjAreaList` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `subjectArea` varchar(255) default NULL,
  UNIQUE KEY `id` (`id`),
  KEY `Index_4` USING BTREE (`subjectArea`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `pf_webRs`
--

CREATE TABLE `pf_webRs` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `pfId` int(10) unsigned NOT NULL,
  `title` varchar(255) default NULL,
  `author` varchar(255) default NULL,
  `url` varchar(255) default NULL,
  `description` text,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `id_2` (`id`,`pfId`),
  KEY `Index_4` USING BTREE (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_bcmBc`
--

CREATE TABLE `tb_bcmBc` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(10) unsigned DEFAULT NULL,
  `barcode` varchar(50) NOT NULL DEFAULT '',
  `status` varchar(25) NOT NULL DEFAULT 'available',
  `pending` int(10) DEFAULT '-1',
  `pendingFor` varchar(25) DEFAULT '',
  `sessionid` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `rid_bc` (`rid`,`barcode`),
  KEY `barcode` (`barcode`),
  KEY `status` (`status`(1)),
  KEY `index_1` (`sessionid`,`pending`,`pendingFor`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

--
-- Table structure for table `tb_bcmRange`
--

CREATE TABLE `tb_bcmRange` (
  `rid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `vid` int(10) unsigned DEFAULT NULL,
  `bcLen` tinyint(4) DEFAULT NULL,
  `preFix` varchar(10) DEFAULT NULL,
  `rangeFr` int(10) unsigned DEFAULT NULL,
  `rangeTo` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`rid`),
  UNIQUE KEY `range` (`vid`,`preFix`,`bcLen`,`rangeFr`,`rangeTo`),
  KEY `vid` (`vid`),
  KEY `preFix` (`preFix`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

--
-- Table structure for table `tb_bcmVendor`
--

CREATE TABLE `tb_bcmVendor` (
  `vid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `vendor` varchar(40) NOT NULL DEFAULT 'Local',
  PRIMARY KEY (`vid`),
  UNIQUE KEY `vendor` (`vendor`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

--
-- Table structure for table `tb_courseList`
--

CREATE TABLE `tb_courseList` (
  `courseId` int(10) unsigned NOT NULL auto_increment,
  `courseCode` varchar(45) NOT NULL,
  `courseName` varchar(150) default NULL,
  `descriptions` text,
  `grade` varchar(45) default NULL,
  `schoolYear` varchar(45) default NULL,
  `level` varchar(45) default NULL,
  `instructionHours` varchar(45) default NULL,
  `prerequisite` varchar(45) default NULL,
  PRIMARY KEY  (`courseId`),
  KEY `Index_2` (`courseCode`,`courseName`,`grade`,`level`,`schoolYear`),
  FULLTEXT KEY `Index_3` (`courseName`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `tb_csvDuplicate`
--

CREATE TABLE `tb_csvDuplicate` (
  `mid` int(10) NOT NULL auto_increment,
  `iid` int(10) unsigned NOT NULL default '0',
  `content` mediumtext NOT NULL,
  PRIMARY KEY  (`mid`),
  KEY `i_iid` (`iid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_csvImport`
--

CREATE TABLE `tb_csvImport` (
  `iid` int(10) unsigned NOT NULL auto_increment,
  `sid` int(10) unsigned default '0',
  `lid` int(10) unsigned default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `sCode` varchar(50) default NULL,
  `dCode` varchar(50) default NULL,
  `lCode` varchar(50) default NULL,
  `itemType` varchar(50) default NULL,
  `bcSelfGen` set('1','0') default '0',
  `bcStart` varchar(50) default NULL,
  `noHolding` enum('1','0') default '0',
  `filename` varchar(255) default NULL,
  `data` mediumtext,
  `header` mediumtext,
  `mapHeader` mediumtext,
  `dataDup` mediumtext,
  `cMerge` tinyint(1) unsigned default '1',
  `countImported` int(10) unsigned default '0',
  `countMerged` int(10) unsigned default '0',
  `countProcessed` int(10) unsigned default '0',
  `countTotal` int(10) unsigned NOT NULL default '0',
  `countTotalHolding` int(10) default NULL,
  `dateImport` datetime default NULL,
  `dateUpload` datetime NOT NULL default '0000-00-00 00:00:00',
  `mesgDigest` varchar(128) default NULL,
  `status` enum('uploaded','rejected','processed','accepted','done') default NULL,
  `addToNewItemList` tinyint(1) unsigned default '0',
  `newItemExpDate` datetime default NULL,
  PRIMARY KEY  (`iid`),
  KEY `i_uid` (`uid`),
  KEY `i_lid` (`lid`),
  KEY `i_msgDigest` (`mesgDigest`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `tb_emailDetails`
--

CREATE TABLE `tb_emailDetails` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `eid` int(10) unsigned NOT NULL DEFAULT '0',
  `eContent` text COLLATE utf8_unicode_ci,
  `eBarcodes` text COLLATE utf8_unicode_ci,
  `subject` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `eTxtContent` text COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


--
-- Table structure for table `tb_emailRequest`
--

CREATE TABLE `tb_emailRequest` (
  `eid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email_cc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `sendDate` datetime DEFAULT NULL,
  `status` enum('sent','waiting','rejected') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'waiting',
  `retryCount` tinyint(5) unsigned NOT NULL DEFAULT '0',
  `requestDate` datetime DEFAULT NULL,
  `modDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`eid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `tb_hold`
--

CREATE TABLE `tb_hold` (
  `id` int(10) NOT NULL auto_increment,
  `idReserve` int(10) unsigned NOT NULL default '0',
  `barcode` varchar(50) NOT NULL default '',
  `dateHold` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateLoan` datetime default NULL,
  `dateCancel` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `i_hold` (`idReserve`,`barcode`,`dateLoan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_index_map`
--

CREATE TABLE `tb_index_map` (
  `id` int(10) NOT NULL auto_increment,
  `fieldId` varchar(100) NOT NULL,
  `fieldName` varchar(255) NOT NULL,
  `subfield` char(1) NOT NULL,
  `repeatable` tinyint(3) unsigned NOT NULL default '0',
  `required` tinyint(3) unsigned NOT NULL default '0',
  `fieldType` tinyint(3) NOT NULL default '0',
  `fId` varchar(10) default NULL,
  `removable` enum('1','0') NOT NULL default '0',
  `selected` enum('1','0') NOT NULL default '0',
  `displayOrder` tinyint(3) NOT NULL,
  `showed` enum('1','0') NOT NULL default '1',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `u_insf` (`fieldId`,`fieldType`,`subfield`),
  KEY `i_fId` (`fId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_itemStatus`
--

CREATE TABLE `tb_itemStatus` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `barcode` varchar(50) NOT NULL default '',
  `ondate` datetime default NULL,
  `status` tinyint(4) default '0',
  `note` varchar(60) default NULL,
  PRIMARY KEY  (`id`),
  KEY `index1` (`barcode`,`ondate`,`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_items`
--

CREATE TABLE `tb_items` (
  `id` int(10) NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '0',
  `barcode` varchar(50) NOT NULL default '',
  `copyNo` varchar(15) DEFAULT NULL,
  `available` tinyint(4) default '1',
  `typeId` varchar(100) NOT NULL default '',
  `locationCode` varchar(40) default '',
  `price` varchar(50) default '',
  `classNumber` varchar(40) default '',
  `acquisitionDate` date default NULL,
  `PONumber` varchar(100) default '',
  `distributor` varchar(100) default '',
  `regionCode` varchar(40) default '',
  `districtCode` varchar(40) default '',
  `buildingCode` varchar(40) default '',
  `budgetCategory` varchar(255) default '',
  `vendorCatalogNumber` varchar(255) default '',
  `importDate` datetime default NULL,
  `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `updating` enum('1','0') NOT NULL default '0',
  `deleted` enum('1','0') NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `barcode` (`barcode`,`deleted`),
  KEY `r_index1` (`rid`,`modDate`,`importDate`,`available`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Table structure for table `tb_loan`
--

CREATE TABLE `tb_loan` (
  `id` int(10) NOT NULL auto_increment,
  `uid` int(10) unsigned NOT NULL default '0',
  `barcode` varchar(50) NOT NULL default '',
  `maxRenewal` tinyint(3) unsigned default '0',
  `dateLoan` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateDue` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateRenewal` datetime default NULL,
  `dateReturn` datetime default NULL,
  `renewalCount` tinyint(4) default '0',
  `finerate` float NOT NULL default '0',
  `status` tinyint(4) default '0',
  `type` varchar(50) default NULL,
  `teacherScheduleId` int(10) unsigned default NULL,
  `teacherName` varchar(255) default NULL,
  `courseName` varchar(255) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `u_bcdl` (`barcode`,`dateLoan`),
  KEY `i_loan` (`uid`,`barcode`,`dateLoan`),
  KEY `i_barcode` (`barcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_marcDuplicate`
--

CREATE TABLE `tb_marcDuplicate` (
  `mid` int(10) unsigned NOT NULL auto_increment,
  `iid` int(10) unsigned NOT NULL default '0',
  `content` mediumtext,
  PRIMARY KEY  (`mid`),
  KEY `i_iid` (`iid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_marcImport`
--

CREATE TABLE `tb_marcImport` (
  `iid` int(10) unsigned NOT NULL auto_increment,
  `sid` int(10) unsigned default '0',
  `lid` int(10) unsigned default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `encoding` enum('UTF-8','MARC-8') NOT NULL default 'UTF-8',
  `sCode` varchar(50) default NULL,
  `lCode` varchar(50) default NULL,
  `itemType` varchar(50) default NULL,
  `cMerge` tinyint(1) unsigned default '1',
  `countImported` int(10) unsigned default '0',
  `countMerged` int(10) unsigned default '0',
  `countProcessed` int(10) unsigned default '0',
  `countTotal` int(10) unsigned NOT NULL default '0',
  `dateImport` datetime default NULL,
  `dateUpload` datetime NOT NULL default '0000-00-00 00:00:00',
  `mesgDigest` varchar(128) default '',
  `status` enum('uploaded','rejected','accepted','indexing','done') NOT NULL default 'uploaded',
  `addToNewItemList` tinyint(1) unsigned default '0',
  `newItemExpDate` datetime default NULL,
  PRIMARY KEY  (`iid`),
  KEY `i_uid` (`uid`),
  KEY `i_lid` (`lid`),
  KEY `i_mesgDigest` (`mesgDigest`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_odl`
--

CREATE TABLE `tb_odl` (
  `odl_id` int(10) unsigned NOT NULL auto_increment,
  `idloan` int(10) unsigned default '0',
  `type` set('overdue','lost','damaged') default 'overdue',
  `days_overdue` tinyint(3) unsigned default '0',
  `ondate` datetime NOT NULL default '0000-00-00 00:00:00',
  `settleDate` datetime default NULL,
  PRIMARY KEY  (`odl_id`),
  KEY `NewIndex` (`odl_id`,`idloan`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_records`
--

CREATE TABLE `tb_records` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL,
  `fId` varchar(10) NOT NULL,
  `fVal` varchar(255) default NULL,
  `updating` enum('0','1') NOT NULL default '0',
  `deleted` enum('1','0') NOT NULL default '0',
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `i_fVal` (`fVal`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_reserve`
--

CREATE TABLE `tb_reserve` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `numCopyReserve` tinyint(4) default '1',
  `dateReserve` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateExpiry` datetime NOT NULL default '0000-00-00 00:00:00',
  `dateCancel` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `i_reserve` (`rid`,`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_teacherSchedule`
--

CREATE TABLE `tb_teacherSchedule` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `courseId` int(8) unsigned default NULL,
  `courseCode` varchar(45) default NULL,
  `teacherId` varchar(45) default NULL,
  `createdDate` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `Index_2` (`courseCode`,`teacherId`,`courseId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_teachers`
--

CREATE TABLE `tb_teachers` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `teacherId` varchar(45) NOT NULL,
  `lastName` varchar(45) default NULL,
  `firstName` varchar(45) default NULL,
  `addrLine1` varchar(150) default NULL,
  `addrLine2` varchar(150) default NULL,
  `city` varchar(45) default NULL,
  `state` varchar(45) default NULL,
  `zip` varchar(25) default NULL,
  `phone` varchar(45) default NULL,
  `country` varchar(45) default 'USA',
  `email` varchar(150) default NULL,
  `birthday` date default NULL,
  `importId` int(11) default NULL,
  `gender` tinyint(1) default NULL,
  `status` tinyint(1) default NULL,
  `notes` text,
  `created` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`),
  KEY `Index_2` USING BTREE (`teacherId`),
  FULLTEXT KEY `Index_3` (`lastName`,`firstName`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

--
-- Table structure for table `tb_transactiondetail`
--

CREATE TABLE `tb_transactiondetail` (
  `tid` int(10) NOT NULL,
  `odl_id` int(10) unsigned NOT NULL default '0',
  `responsible` varchar(64) default '',
  `materials` set('book','video','DVD','reserve material') default 'book',
  `rate` float(10,2) default '0.00',
  `overdueDays` tinyint(3) unsigned default '0',
  `fineAmount` float(10,2) default '0.00',
  `forgivenAmount` float(10,2) default '0.00',
  `amount` float(10,2) default '0.00',
  `taxes` float(10,2) default '0.00',
  `note` varchar(254) default '',
  PRIMARY KEY  (`tid`),
  KEY `NewIndex` (`tid`,`odl_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Table structure for table `tb_transactions`
--

CREATE TABLE `tb_transactions` (
  `tid` int(10) unsigned NOT NULL auto_increment,
  `ptid` int(10) unsigned NOT NULL default '0',
  `code` smallint(6) default NULL,
  `uid` int(10) unsigned NOT NULL default '0',
  `amount` float(10,2) default '0.00',
  `balance` float(10,2) NOT NULL default '0.00',
  `date` datetime default '0000-00-00 00:00:00',
  `description` varchar(50) default NULL,
  `settleDate` datetime default NULL,
  PRIMARY KEY  (`tid`),
  UNIQUE KEY `tid` (`tid`),
  KEY `tid_2` (`tid`,`uid`,`date`,`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


--
-- Table structure for table `opl_bcmBc`
--

CREATE TABLE `opl_bcmBc` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned default NULL,
  `barcode` varchar(50) NOT NULL default '',
  `status` varchar(25) NOT NULL default 'available',
  `pending` int(10) default '-1',
  `pendingFor` varchar(25) default '',
  `sessionid` varchar(40) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `rid_bc` (`rid`,`barcode`),
  KEY `barcode` (`barcode`),
  KEY `status` (`status`(1)),
  KEY `index_1` (`sessionid`,`pending`,`pendingFor`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

--
-- Table structure for table `opl_bcmRange`
--

CREATE TABLE `opl_bcmRange` (
  `rid` int(10) unsigned NOT NULL auto_increment,
  `vid` int(10) unsigned default NULL,
  `bcLen` tinyint(4) default NULL,
  `preFix` varchar(10) default NULL,
  `rangeFr` int(10) unsigned default NULL,
  `rangeTo` int(10) unsigned default NULL,
  PRIMARY KEY  (`rid`),
  UNIQUE KEY `range` (`vid`,`preFix`,`bcLen`,`rangeFr`,`rangeTo`),
  KEY `vid` (`vid`),
  KEY `preFix` (`preFix`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

--
-- Table structure for table `opl_bcmVendor`
--

CREATE TABLE `opl_bcmVendor` (
  `vid` int(10) unsigned NOT NULL auto_increment,
  `vendor` varchar(40) NOT NULL default 'Local',
  PRIMARY KEY  (`vid`),
  UNIQUE KEY `vendor` (`vendor`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

--
-- Table structure for table `opl_portalLayout`
--
CREATE TABLE `opl_portalLayout` (
  `tid` int(10) unsigned NOT NULL default '0',
  `cid` int(10) unsigned NOT NULL auto_increment,
  `colPos` tinyint(3) unsigned NOT NULL default '1',
  `rowPos` tinyint(3) unsigned NOT NULL default '1',
  `cWidth` smallint(4) default NULL,
  `cHeight` smallint(4) default NULL,
  UNIQUE KEY `cid` (`cid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `opl_portlet`
--

CREATE TABLE `opl_portlet` (
  `pid` int(10) unsigned NOT NULL auto_increment,
  `cid` int(10) unsigned NOT NULL,
  `ordinal` tinyint(3) default NULL,
  `type` enum('aboutUs','rss','search','libraryHours','newItemList','newsEvents','image','webLinks','pathfinders','weather','reviewItemList','calendar','html','pfShowcase','libShowcase') default NULL,
  UNIQUE KEY `pid` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `opl_portletProp`
--
CREATE TABLE `opl_portletProp` (
  `pid` int(10) unsigned NOT NULL,
  `var` varchar(255) default NULL,
  `val` text,
  UNIQUE KEY `propId` (`pid`,`var`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `opl_portalTheme`
--
CREATE TABLE `opl_portalTheme` (
  `tid` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `css` varchar(255) default NULL,
  UNIQUE KEY `tid` (`tid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `pf_subject` (
  `pfId` int(10) unsigned NOT NULL,
  `subject` varchar(255) default NULL,
  KEY `index1` USING BTREE (`pfId`,`subject`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



CREATE TABLE `opl_featureItem` (   
    `id` int(10) unsigned NOT NULL auto_increment,   
    `rid` int(10) unsigned NOT NULL default '1',  
    `feature` varchar(40) NOT NULL default '',   
    `expiryDate` datetime default NULL,   
    `modDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  
     PRIMARY KEY  (`id`),   
     UNIQUE KEY `rid_feature` (`rid`,`feature`) 
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `sip_session`
--

CREATE TABLE `sip_session` (
  `sessionid` varchar(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `sc` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `ipaddress` varchar(15) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `debug` enum('true','false') default 'false',
  `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`sessionid`),
  KEY `i_sc` (`sc`),
  KEY `i_ip` (`ipaddress`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `opl_ridBid`
--

CREATE TABLE `opl_ridBid` (
  `rid` int(10) unsigned NOT NULL,
  `bid` int(10) unsigned NOT NULL,
  UNIQUE KEY `u_ridBid` (`bid`,`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;


--
-- Table structure for table `opl_ebLoan`
--
CREATE TABLE `opl_ebLoan` (
  `idloan` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `bid` int(10) unsigned DEFAULT NULL,
  `uid` int(10) unsigned NOT NULL,
  `dateLoan` datetime DEFAULT NULL,
  `dateDue` datetime DEFAULT NULL,
  `dateReturn` datetime DEFAULT NULL,
  `note` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`idloan`),
  KEY `i_loan` (`bid`,`uid`,`dateLoan`,`dateDue`,`dateReturn`)
) ENGINE=MyISAM DEFAULT  CHARSET=utf8 ;

--
-- Table structure for table `opl_ebReserve`
--

CREATE TABLE `opl_ebReserve` (
  `idReserve` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `idloan` int(10) unsigned NOT NULL DEFAULT '0',
  `bid` int(10) unsigned DEFAULT NULL,
  `uid` int(10) unsigned NOT NULL,
  `dateReserve` datetime DEFAULT NULL,
  `dateExpiry` datetime DEFAULT NULL,
  `dateCancel` datetime DEFAULT NULL,
  `notified` tinyint(3) unsigned DEFAULT '0',
  PRIMARY KEY (`idReserve`),
  KEY `i_reserve` (`bid`,`uid`),
  KEY `idloan` (`idloan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `opl_ebReadingStats`
--

 CREATE TABLE `opl_ebReadingStats` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(10) unsigned NOT NULL,
  `bid` int(10) unsigned DEFAULT NULL,
  `uid` int(10) unsigned DEFAULT NULL,
  `onDate` date DEFAULT NULL,
  `onTime` time DEFAULT NULL,
  `type` set('read','preview') DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


--
-- Table structure for table `eb_bookmark`
--

CREATE TABLE `eb_bookmark` (
  `bmId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL,
  `bid` int(10) unsigned DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `note` text COLLATE utf8_unicode_ci,
  `fid` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `percFr` varchar(25) COLLATE utf8_unicode_ci DEFAULT '0.00',
  `percTo` varchar(25) COLLATE utf8_unicode_ci DEFAULT '0.00',
  `bmDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`bmId`),
  UNIQUE KEY `u_key` (`uid`,`bid`,`fid`,`percFr`,`percTo`),
  KEY `bmkKey` (`uid`,`bid`,`fid`),
  KEY `percent` (`percFr`,`percTo`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `eb_bookshelves`
--

CREATE TABLE `eb_bookshelves` (
  `bsId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL,
  `rid` int(10) unsigned DEFAULT NULL,
  `note` varchar(255) NOT NULL DEFAULT '',
  `addDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`bsId`),
  UNIQUE KEY `u_key` (`uid`,`rid`),
  KEY `uid` (`uid`),
  KEY `rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `eb_lastAccessPage`
--

CREATE TABLE `eb_lastAccessPage` (
  `placeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL,
  `fid` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `percent` varchar(25) COLLATE utf8_unicode_ci DEFAULT '0.00',
  `lastAccess` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`placeId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Table structure for table `eb_licMgnt`
--

CREATE TABLE `eb_licMgnt` (
  `licId` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL,
  `bid` int(10) unsigned DEFAULT NULL,
  `licenseType` set('free','paid','rental') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'paid',
  `noLicense` int(10) unsigned NOT NULL DEFAULT '0',
  `datePurchase` datetime DEFAULT NULL,
  `modDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `poNum` varchar(50) NOT NULL DEFAULT '',
  `vendor` varchar(255) NOT NULL DEFAULT '',
  `deleted` smallint(3) DEFAULT '0',
  `startDate` datetime DEFAULT NULL,
  `endDate` datetime DEFAULT NULL,
  `note` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`licId`),
  KEY `bid` (`bid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Table structure for table `eb_licMgntLog`
--

CREATE TABLE `eb_licMgntLog` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `logDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `licId` int(10) unsigned NOT NULL,
  `uid` int(10) unsigned NOT NULL,
  `bid` int(10) unsigned DEFAULT NULL,
  `licenseType` set('free','paid','rental') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `noLicense` int(10) unsigned NOT NULL DEFAULT '0',
  `datePurchase` datetime DEFAULT NULL,
  `modDate` datetime NOT NULL,
  `poNum` varchar(50) NOT NULL DEFAULT '',
  `vendor` varchar(255) NOT NULL DEFAULT '',
  `startDate` datetime DEFAULT NULL,
  `endDate` datetime DEFAULT NULL,
  `note` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `id` (`licId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `opl_srchLog` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `page` varchar(100) DEFAULT '',
  `searchType` varchar(100) DEFAULT 'regular',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `query` text,
  `hits` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ind_1` (`page`,`hits`,`date`,`searchType`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `opl_reserveShelf` (
  `shelfId` 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,
  `teacher` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `course` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
  `createdDate` datetime DEFAULT NULL,
  `reserveFrom` datetime DEFAULT '0000-00-00 00:00:00',
  `reserveTo` datetime DEFAULT '0000-00-00 00:00:00',
  `loanPeriod` int(10) unsigned NOT NULL DEFAULT '0',
  `loanType` set('hourly','daily','default') COLLATE utf8_unicode_ci DEFAULT 'daily',
  `modDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `deleted` tinyint(3) unsigned DEFAULT '0',
  PRIMARY KEY (`shelfId`),
  KEY `key1` (`title`,`author`,`teacher`,`course`,`loanPeriod`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE `opl_reserveShelfUsers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `shelfId` int(10) unsigned NOT NULL,
  `uid` int(20) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `key1` (`shelfId`,`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

CREATE TABLE `opl_reserveShelfItems` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `shelfId` 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 '',
  `deleted` tinyint(3) unsigned DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE `opl_reserveShelfSubject` (
  `shelfId` int(10) unsigned NOT NULL,
  `subject` varchar(255) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

CREATE TABLE `opl_reserveShelfGroup` (
  `groupId` int(10) unsigned NOT NULL DEFAULT '0',
  `shelfId` int(10) unsigned NOT NULL,
  `header` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `description` text CHARACTER SET utf8,
  `deleted` tinyint(3) unsigned DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

CREATE TABLE `opl_ILL_out` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned DEFAULT NULL,
  `ILL_id` int(10) unsigned NOT NULL DEFAULT '0',
  `ILL_loanId` varchar(20) NOT NULL DEFAULT '',
  `ILL_lid` int(10) unsigned NOT NULL,
  `ILL_lName` varchar(150) DEFAULT '',
  `barcode` varchar(20) NOT NULL DEFAULT '',
  `status` enum('loan','return','receive','lost','found') DEFAULT NULL,
  `dateLoan` datetime DEFAULT NULL,
  `dateDue` datetime DEFAULT NULL,
  `dateReturn` datetime DEFAULT NULL,
  `dateReqReceived` datetime DEFAULT NULL,
  `dateLost` datetime DEFAULT NULL,
  `dateFound` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `opl_ILL_in` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ILL_id` int(10) unsigned NOT NULL DEFAULT '0',
  `ILL_loanId` varchar(20) DEFAULT NULL,
  `ILL_lid` int(10) unsigned NOT NULL,
  `ILL_lName` varchar(150) DEFAULT '',
  `ILL_itemBc` varchar(20) DEFAULT '',
  `local_bc` varchar(50) NOT NULL DEFAULT '',
  `status` enum('loan','return','receive','lost','found') DEFAULT NULL,
  `dateLoan` datetime DEFAULT NULL,
  `dateDue` datetime DEFAULT NULL,
  `dateReturn` datetime DEFAULT NULL,
  `dateResReceived` datetime DEFAULT NULL,
  `dateLost` datetime DEFAULT NULL,
  `dateFound` datetime DEFAULT NULL,
  `title` text,
  `author` text,
  `isbn` varchar(100) DEFAULT NULL,
  `sf852h` varchar(255) NOT NULL DEFAULT '',
  `sf852i` varchar(255) NOT NULL DEFAULT '',
  `sf852k` varchar(255) NOT NULL DEFAULT '',
  `pubDate` varchar(50) DEFAULT NULL,
  `pubPlace` varchar(150) DEFAULT NULL,
  `pubName` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE  `opl_ILL_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned DEFAULT NULL,
  `lid` int(10) unsigned DEFAULT NULL,
  `lName` varchar(150)  DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE `opl_authCtrl` (
  `tag` varchar(3) NOT NULL DEFAULT '',
  `sfCode` char(1) NOT NULL DEFAULT '',
  `sfData` varchar(255) NOT NULL DEFAULT '',
  UNIQUE KEY `authCtrKey` (`tag`,`sfCode`,`sfData`),
  KEY `authCtr` (`sfData`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

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;

CREATE TABLE `opl_transaction` (
  `tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cid` int(10) unsigned NOT NULL,
  `pid` int(10) unsigned DEFAULT NULL,
  `code` smallint(6) DEFAULT NULL,
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `responsible` int(10) unsigned NOT NULL,
  `creditUsed_tid` int(10) unsigned DEFAULT NULL,
  `amount` float(10,2) NOT NULL DEFAULT '0.00',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `description` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`tid`),
  UNIQUE KEY `tid` (`tid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `opl_paymentReceipt` (
  `pid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `recieved` float(10,2) DEFAULT '0.00',
  `withdrawn` float(10,2) DEFAULT '0.00',
  `accountBalance` float(10,2) DEFAULT '0.00',
  `payMethod` varchar(50) DEFAULT 'cash',
  `tender` float(10,2) DEFAULT '0.00',
  `changeAmnt` float(10,2) DEFAULT '0.00',
  `ondate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`pid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

 CREATE TABLE `opl_charge` (
  `cid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `odl_id` int(10) unsigned DEFAULT NULL,
  `svc_id` int(10) unsigned DEFAULT NULL,
  `responsible` int(10) unsigned NOT NULL,
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `materials` set('book','video','DVD','reserve material') DEFAULT 'book',
  `rate` float(10,2) DEFAULT '0.00',
  `unit` int(10) unsigned DEFAULT '1',
  `waive` float(10,2) DEFAULT '0.00',
  `creditRefund` float(10,2) DEFAULT '0.00',
  `creditUsed` float(10,2) DEFAULT '0.00',
  `refund` float(10,2) DEFAULT '0.00',
  `chargeAmnt` float(10,2) DEFAULT '0.00',
  `fee` float(10,2) DEFAULT '0.00',
  `totalCharge` float(10,2) DEFAULT '0.00',
  `paid` float(10,2) DEFAULT '0.00',
  `balance` float(10,2) DEFAULT '0.00',
  `taxes` float(10,2) DEFAULT '0.00',
  `note` varchar(254) DEFAULT '',
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  KEY `NewIndex` (`cid`,`odl_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

CREATE TABLE `SIF_studentEnrollment` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `refId` varchar(100) DEFAULT '',
  `studentRefId` varchar(50) DEFAULT '',
  `schoolInfoRefId` varchar(50) DEFAULT '',
  `advisorRefId` varchar(50) DEFAULT '',
  `homeRoomRefId` varchar(50) DEFAULT '',
  `counselorRefId` varchar(50) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `ind_1` (`refId`,`schoolInfoRefId`,`advisorRefId`,`studentRefId`,`homeRoomRefId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `SIF_roomInfo` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `refId` varchar(100) DEFAULT '',
  `schoolInfoRefId` varchar(100) DEFAULT '',
  `description` text,
  `building` varchar(100) DEFAULT '',
  `roomNumber` varchar(100) DEFAULT '',
  `homeroomNumber` varchar(100) DEFAULT '',
  `size` varchar(20) DEFAULT '',
  `capacity` varchar(100) DEFAULT '',
  `phone` varchar(100) DEFAULT '',
  `staffList` text,
  PRIMARY KEY (`id`),
  KEY `ind_1` (`refId`,`schoolInfoRefId`),
  KEY `ind_2` (`building`,`homeroomNumber`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

CREATE TABLE `SIF_schoolInfo` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `refId` varchar(100) DEFAULT '',
  `localId` varchar(50) DEFAULT '',
  `stateProvinceId` varchar(50) DEFAULT '',
  `NCESId` varchar(50) DEFAULT '',
  `schoolName` varchar(255) DEFAULT '',
  `schoolUrl` varchar(255) DEFAULT '',
  `principalName` varchar(100) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `ind_1` (`refId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `SIF_staffPersonal` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `refId` varchar(100) DEFAULT '',
  `localId` varchar(100) DEFAULT '',
  `employeePersonalRefId` varchar(100) DEFAULT '',
  `barcode` varchar(100) DEFAULT '',
  `firstname` varchar(100) DEFAULT '',
  `lastname` varchar(100) DEFAULT '',
  `middlename` varchar(100) DEFAULT '',
  `preferredName` varchar(100) DEFAULT '',
  `gender` tinyint(4) DEFAULT NULL,
  `email` varchar(100) DEFAULT '',
  `addressLine1` varchar(100) DEFAULT '',
  `addressLine2` varchar(100) DEFAULT '',
  `city` varchar(100) DEFAULT '',
  `state` varchar(100) DEFAULT '',
  `country` varchar(100) DEFAULT '',
  `zipCode` varchar(100) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `idx1` (`refId`,`localId`),
  KEY `idx2` (`employeePersonalRefId`,`barcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



CREATE TABLE `opl_preSelUserList`(
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `uidList` text,
  `dateCreated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;





