LP#1541559: Change order of test bib loading
authorBen Shum <ben@evergreener.net>
Tue, 21 Feb 2017 03:34:54 +0000 (22:34 -0500)
committerKathy Lussier <klussier@masslnc.org>
Tue, 21 Feb 2017 16:19:32 +0000 (11:19 -0500)
Move the new ebook bibs to the end of the script and away from the
rest of bib loading and item creation to avoid breaking tests.

Signed-off-by: Ben Shum <ben@evergreener.net>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/tests/datasets/sql/load_all.sql

index 54d4e55..50ea078 100644 (file)
@@ -30,9 +30,6 @@ BEGIN;
 -- load RDA bibs
 \i bibs_rda.sql
 
--- load EbookAPI bibs
-\i bibs_ebook_api.sql
-
 -- insert all loaded bibs into the biblio.record_entry in insert order
 INSERT INTO biblio.record_entry (marc, last_xact_id) 
     SELECT marc, tag FROM marcxml_import ORDER BY id;
@@ -68,6 +65,16 @@ INSERT INTO biblio.record_entry (marc, last_xact_id)
 -- funds, orders, etc.
 \i acq.sql
 
+-- delete previously imported bibs
+DELETE FROM marcxml_import;
+
+-- load EbookAPI bibs
+\i bibs_ebook_api.sql
+
+-- insert all loaded bibs into the biblio.record_entry in insert order
+INSERT INTO biblio.record_entry (marc, last_xact_id)
+    SELECT marc, tag FROM marcxml_import ORDER BY id;
+
 -- clean up the env
 \i env_destroy.sql