Created
November 3, 2016 15:58
-
-
Save stompro/05f0ae17da1625e9001bde9281e1cdd1 to your computer and use it in GitHub Desktop.
Copy item templates for certain users - Evergreen
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
-- Method of keeping the copy/item templates the same for certain users. | |
-- Copy Linda's copy templates to Molly and Jeanne | |
begin; | |
-- LARL Catalogers Updates | |
update actor.usr_setting aus | |
set value=auslinda.value | |
from actor.usr_setting auslinda | |
where | |
auslinda.usr = 112817 | |
and auslinda.name = 'staff_client.copy_editor.templates' | |
and aus.name='staff_client.copy_editor.templates' | |
and aus.usr in (112815,112814) | |
and auslinda.value!=aus.value --only update when they don't match Lindas values | |
returning md5(aus.value),md5(auslinda.value) | |
; | |
select aus.id, aus.usr, aus.name, substring(aus.value from 0 for 60) from actor.usr_setting aus | |
where | |
aus.usr in (112817,112815,112814) | |
and aus.name='staff_client.copy_editor.templates' | |
; | |
rollback; | |
-- Copy Tammee's templates to Laura Schafer schaferl-cat | |
begin; | |
update actor.usr_setting aus | |
set value=austammee.value | |
from actor.usr_setting austammee | |
where | |
austammee.usr = 112809 | |
and austammee.name = 'staff_client.copy_editor.templates' | |
and aus.name='staff_client.copy_editor.templates' | |
and aus.usr in (112811) | |
and austammee.value!=aus.value --only update when they don't match Lindas values | |
returning md5(aus.value),md5(austammee.value) | |
; | |
select aus.id, aus.usr, aus.name, substring(aus.value from 0 for 60) from actor.usr_setting aus | |
where | |
aus.usr in (112809,112811) | |
and aus.name='staff_client.copy_editor.templates' | |
; | |
rollback; | |
-- Copy Heather Barber's templates to Mary Casavan casavanm-ill | |
begin; | |
update actor.usr_setting aus | |
set value=ausbarberh.value | |
from actor.usr_setting ausbarberh | |
where | |
ausbarberh.usr = 112808 | |
and ausbarberh.name = 'staff_client.copy_editor.templates' | |
and aus.name='staff_client.copy_editor.templates' | |
and aus.usr in (112810) | |
and ausbarberh.value!=aus.value --only update when they don't match Lindas values | |
returning md5(aus.value),md5(ausbarberh.value) | |
; | |
select aus.id, aus.usr, aus.name, substring(aus.value from 0 for 60) from actor.usr_setting aus | |
where | |
aus.usr in (112808,112810) | |
and aus.name='staff_client.copy_editor.templates' | |
; | |
rollback; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment