Last active
March 11, 2016 19:06
-
-
Save Dyrcona/4198606 to your computer and use it in GitHub Desktop.
A simple, little SQL script to reingest bibs in 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
-- A simple SQL to "reingest" your bib records in Evergreen. | |
-- Feel free to use it however you like, though the easiest way is to | |
-- save it into a file and do psql -f filename. | |
DO $$ | |
DECLARE | |
flag BOOLEAN; | |
BEGIN | |
SELECT enabled INTO flag | |
FROM config.internal_flag | |
WHERE name = 'ingest.reingest.force_on_same_marc'; | |
IF flag IS FALSE THEN | |
UPDATE config.internal_flag | |
SET enabled = TRUE | |
WHERE name = 'ingest.reingest.force_on_same_marc'; | |
END IF; | |
UPDATE biblio.record_entry | |
SET marc = marc | |
WHERE id > 0; | |
IF flag IS FALSE THEN | |
UPDATE config.internal_flag | |
SET enabled = flag | |
WHERE name = 'ingest.reingest.force_on_same_marc'; | |
END IF; | |
END$$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment