This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"hrefmn Ad Bk Ref MN Non Fiction": { | |
"Status": { | |
"value": "5", | |
"field": "status", | |
"type": "attribute" | |
}, | |
"Price": { | |
"value": "30.00", | |
"field": "price", | |
"type": "attribute" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Copy old asset.copy(alert_message) to asset.copy_alert and vice versa | |
-- For situations when some staff are still using xul and some have moved to web staff client. | |
CREATE or replace FUNCTION larl_copy_old_new_alert() RETURNS trigger AS $larl_copy_old_new_alert$ | |
BEGIN | |
if TG_OP = 'UPDATE' then | |
-- alert_message is now null - mark matching asset.copy_alert as clear | |
if NEW.alert_message is null then | |
update asset.copy_alert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\echo Post-Hook SQL Scripts - Run after new events have been created. | |
begin; | |
\echo Summary of events for event_def=117 | |
select state,count(id) from action_trigger.event where event_def=117 group by state; | |
\echo Change event to invalid if patron has no email address. | |
update action_trigger.event ate | |
set state='invalid',update_time=now() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Auditor Bloat and cluster | |
-------------------------------- | |
-- cluster asset_copy_history | |
-- Create index to cluster on | |
create index aud_asset_cp_cluster on auditor.asset_copy_history using btree(id,audit_id); | |
cluster verbose auditor.asset_copy_history using aud_asset_cp_cluster; | |
--remove cluster index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: evergreen | |
# Required-Start: $remote_fs $syslog ejabberd | |
# Should-Start: postgresql memcached apache2 | |
# Required-Stop: $remote_fs $syslog | |
# Should-Stop: apache2 memcached postgresql | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before you try to clean up your authority records, you should have run the authority linking scripts, | |
and then set them up to run on a regular basis via cron. | |
#Link bibs to authorities | |
/openils/bin/authority_control_fields.pl -a | |
#Link authorities to other authorities. | |
/openils/bin/authority_authority_linker.pl -a | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rollback; | |
begin; | |
select larl_temp.colpivot('_output',$$ | |
select --acn.record | |
acp.id | |
, acp.barcode | |
, acp.circ_modifier | |
,ascc.name, asce.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- List of all 490 a | |
select mrfr.value,count(distinct mrfr.record),string_agg(distinct mrfr.record::text,', ') from metabib.real_full_rec mrfr | |
where | |
mrfr.tag='490' | |
and mrfr.subfield='a' | |
--limit 100 | |
group by mrfr.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\pset format html | |
\echo <h1>Allow LARL holds on NWRL age protected items</h1> | |
\echo <h2>NWRL Items that could fill LARL holds</h2> | |
begin; | |
-- Create temp table to store NWRL copies that are canidates for removing age hold protection. | |
create temporary table nwrl_new | |
on commit drop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin; | |
-- Look for preference set to null, blank or false and remove it. | |
delete from actor.usr_setting aus | |
where | |
aus.name='history.circ.retention_start' | |
and (aus.value is null or aus.value = 'false' or aus.value='') | |
returning aus.* | |
; |