Remove 2.1 bits that infiltrated 2.0 database upgrades
authorDan Scott <dan@coffeecode.net>
Mon, 13 Jun 2011 00:23:47 +0000 (20:23 -0400)
committerDan Scott <dan@coffeecode.net>
Mon, 13 Jun 2011 00:23:47 +0000 (20:23 -0400)
Core schema was fine, but the cherry-picked upgrade script didn't show
any conflicts (naturally) so some pieces of the 2.1 schema that don't
exist in 2.0 made their way into the 0554 upgrade script.

Thanks to Ben Shum for catching this.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/sql/Pg/upgrade/0554.unnest_search_query_parser_fts.sql

index 498a98d..57849c7 100644 (file)
@@ -158,20 +158,9 @@ BEGIN
               LIMIT 1;
 
             IF NOT FOUND THEN
-                PERFORM 1
-                  FROM  biblio.peer_bib_copy_map pr
-                        JOIN asset.copy cp ON (cp.id = pr.target_copy)
-                  WHERE NOT cp.deleted
-                        AND cp.status IN ( SELECT * FROM unnest( param_statuses ) )
-                        AND pr.peer_record IN ( SELECT * FROM unnest( core_result.records ) )
-                        AND cp.circ_lib IN ( SELECT * FROM unnest( search_org_list ) )
-                  LIMIT 1;
-
-                IF NOT FOUND THEN
-                -- RAISE NOTICE ' % and multi-home linked records were all status-excluded ... ', core_result.records;
-                    excluded_count := excluded_count + 1;
-                    CONTINUE;
-                END IF;
+                -- RAISE NOTICE ' % were all status-excluded ... ', core_result.records;
+                excluded_count := excluded_count + 1;
+                CONTINUE;
             END IF;
 
         END IF;
@@ -189,20 +178,9 @@ BEGIN
               LIMIT 1;
 
             IF NOT FOUND THEN
-                PERFORM 1
-                  FROM  biblio.peer_bib_copy_map pr
-                        JOIN asset.copy cp ON (cp.id = pr.target_copy)
-                  WHERE NOT cp.deleted
-                        AND cp.location IN ( SELECT * FROM unnest( param_locations ) )
-                        AND pr.peer_record IN ( SELECT * FROM unnest( core_result.records ) )
-                        AND cp.circ_lib IN ( SELECT * FROM unnest( search_org_list ) )
-                  LIMIT 1;
-
-                IF NOT FOUND THEN
-                    -- RAISE NOTICE ' % and multi-home linked records were all copy_location-excluded ... ', core_result.records;
-                    excluded_count := excluded_count + 1;
-                    CONTINUE;
-                END IF;
+                -- RAISE NOTICE ' % were all copy_location-excluded ... ', core_result.records;
+                excluded_count := excluded_count + 1;
+                CONTINUE;
             END IF;
 
         END IF;
@@ -216,19 +194,9 @@ BEGIN
               LIMIT 1;
 
             IF NOT FOUND THEN
-                PERFORM 1
-                  FROM  biblio.peer_bib_copy_map pr
-                        JOIN asset.opac_visible_copies cp ON (cp.copy_id = pr.target_copy)
-                  WHERE cp.circ_lib IN ( SELECT * FROM unnest( search_org_list ) )
-                        AND pr.peer_record IN ( SELECT * FROM unnest( core_result.records ) )
-                  LIMIT 1;
-
-                IF NOT FOUND THEN
-
-                    -- RAISE NOTICE ' % and multi-home linked records were all visibility-excluded ... ', core_result.records;
-                    excluded_count := excluded_count + 1;
-                    CONTINUE;
-                END IF;
+                -- RAISE NOTICE ' % were all visibility-excluded ... ', core_result.records;
+                excluded_count := excluded_count + 1;
+                CONTINUE;
             END IF;
 
         ELSE
@@ -245,25 +213,14 @@ BEGIN
             IF NOT FOUND THEN
 
                 PERFORM 1
-                  FROM  biblio.peer_bib_copy_map pr
-                        JOIN asset.copy cp ON (cp.id = pr.target_copy)
-                  WHERE NOT cp.deleted
-                        AND cp.circ_lib IN ( SELECT * FROM unnest( search_org_list ) )
-                        AND pr.peer_record IN ( SELECT * FROM unnest( core_result.records ) )
+                  FROM  asset.call_number cn
+                  WHERE cn.record IN ( SELECT * FROM unnest( core_result.records ) )
                   LIMIT 1;
 
-                IF NOT FOUND THEN
-
-                    PERFORM 1
-                      FROM  asset.call_number cn
-                      WHERE cn.record IN ( SELECT * FROM unnest( core_result.records ) )
-                      LIMIT 1;
-
-                    IF FOUND THEN
-                        -- RAISE NOTICE ' % and multi-home linked records were all visibility-excluded ... ', core_result.records;
-                        excluded_count := excluded_count + 1;
-                        CONTINUE;
-                    END IF;
+                IF FOUND THEN
+                    -- RAISE NOTICE ' % were all visibility-excluded ... ', core_result.records;
+                    excluded_count := excluded_count + 1;
+                    CONTINUE;
                 END IF;
 
             END IF;