CREATE TABLE `opl_recordArchive` (
  `archId` int(10) unsigned NOT NULL auto_increment,
  `rid` int(10) unsigned NOT NULL default '1',
  `onDate` datetime default NULL,
  `marcXml` text,
  PRIMARY KEY  (`archId`),
  KEY `rid` (`rid`,`onDate`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;


 
ALTER TABLE opl_marcRecord
ADD  `recFormat` set('book','journal','artifact','photoPoster','musicCassette','bookOnTape','movie','libraryKit','map','sheetMusic','internet','electronicMedia','CDMusic','compactDisc') default 'book',
ADD  `literaryForm` varchar(100) default 'unknown';


 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;


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 ;

ALTER table  pf_record ADD  `audience` varchar(255) character set latin1 default NULL      ;
ALTER table  pf_record ADD  `xml` text ;     

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;

ALTER table opl_file add `fRealName` varchar(255) default NULL after fileName;

insert into opl_preference(var,val,valShow,opt,varType,description,gid,gOrder) 
    values('bookingReserve',1,'On','0|1','radio','enable/disable Booking Reserve function',5,28);

insert into opl_prefFormParam(var,listOrder,name,val) 
    values('bookingReserve',0,'On',1),('bookingReserve',1,'Off',0);

alter table opl_portlet change `type` `type` enum('aboutUs','rss','search','libraryHours','newItemList','newsEvents','image','webLinks','pathfinders','weather','reviewItemList') DEFAULT NULL;


insert into opl_preference set var='googlePreview', val=1,valShow='On',opt='0|1',varType='radio',description='Turn Google Preview Off/Off',gid=5,gOrder=29;
insert into opl_prefFormParam set var='googlePreview',listOrder=0,name='On',val=1;
insert into opl_prefFormParam set var='googlePreview',listOrder=1,name='Off',val=0;
