From 09a0d780a665808a979c2706530497fe151c49d3 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Tue, 14 Jan 2020 11:49:48 -0500 Subject: [PATCH] make collision reports smarter to avoid other x characters at start of barcode being a false positive --- mig-xml/evergreen_staged_report.xml | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mig-xml/evergreen_staged_report.xml b/mig-xml/evergreen_staged_report.xml index c03e788..b8ab88b 100644 --- a/mig-xml/evergreen_staged_report.xml +++ b/mig-xml/evergreen_staged_report.xml @@ -382,7 +382,7 @@ assets 0 Collision Count - SELECT COUNT(id) FROM m_asset_copy_legacy WHERE x_migrate = TRUE AND barcode LIKE 'x_%' + SELECT COUNT(id) FROM m_asset_copy_legacy WHERE x_migrate = TRUE AND barcode ~* '^x_' Incumbent collisions are those where the migrated barcodes collide with existing barcodes in the database. @@ -392,7 +392,7 @@ assets 1 Collision Count - SELECT COUNT(id) FROM m_asset_copy WHERE barcode LIKE 'x_%' + SELECT COUNT(id) FROM m_asset_copy WHERE barcode ~* '^x_' Incumbent collisions are those where the migrated barcodes collide with existing barcodes in the database. @@ -402,7 +402,7 @@ assets 0 Collision List - SELECT ac.barcode FROM m_asset_copy_legacy ac WHERE ac.barcode LIKE 'x_%' AND ac.x_migrate = TRUE ORDER BY 1 LIMIT 20 + SELECT ac.barcode FROM m_asset_copy_legacy ac WHERE ac.barcode ~* '^x_' AND ac.x_migrate = TRUE ORDER BY 1 LIMIT 20 This is a shortlist of copy barcode collisions that maxes out at 20. If there are more collisions we will need to run a custom report. @@ -412,7 +412,7 @@ assets 1 Collision List - SELECT ac.barcode FROM m_asset_copy ac WHERE ac.barcode LIKE 'x_%' ORDER BY 1 LIMIT 20 + SELECT ac.barcode FROM m_asset_copy ac WHERE ac.barcode ~* '^x_' ORDER BY 1 LIMIT 20 This is a shortlist of patron barcode collisions that maxes out at 20. If there are more collisions we will need to run a custom report. @@ -422,7 +422,7 @@ assets 0 Number of Barcodes Matching Pattern Greater than 10.Left 60% of Characters - SELECT COUNT(ac.id), LEFT(ac.barcode,(ROUND(LENGTH(ac.barcode)*.6))::INT) FROM m_asset_copy_legacy ac WHERE barcode LIKE 'x_%' AND ac.x_migrate = TRUE GROUP BY 2 HAVING COUNT(ac.id) > 10 ORDER BY 2 + SELECT COUNT(ac.id), LEFT(ac.barcode,(ROUND(LENGTH(ac.barcode)*.6))::INT) FROM m_asset_copy_legacy ac WHERE barcode ~* '^x_' AND ac.x_migrate = TRUE GROUP BY 2 HAVING COUNT(ac.id) > 10 ORDER BY 2 @@ -431,7 +431,7 @@ assets 1 Number of Barcodes Matching Pattern Greater than 10.Left 60% of Characters - SELECT COUNT(ac.id), LEFT(ac.barcode,(ROUND(LENGTH(ac.barcode)*.6))::INT) FROM m_asset_copy ac WHERE barcode LIKE 'x_%' GROUP BY 2 HAVING COUNT(ac.id) > 10 ORDER BY 2 + SELECT COUNT(ac.id), LEFT(ac.barcode,(ROUND(LENGTH(ac.barcode)*.6))::INT) FROM m_asset_copy ac WHERE barcode ~* '^x_' GROUP BY 2 HAVING COUNT(ac.id) > 10 ORDER BY 2 @@ -809,7 +809,7 @@ id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3 actors 0 Collision Count - SELECT COUNT(acard.id) FROM m_actor_card_legacy acard WHERE barcode LIKE 'x_%' AND x_migrate = TRUE + SELECT COUNT(acard.id) FROM m_actor_card_legacy acard WHERE barcode ~* '^x_' AND x_migrate = TRUE @@ -818,7 +818,7 @@ id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3 actors 1 Collision Count - SELECT COUNT(acard.id) FROM m_actor_card acard WHERE barcode LIKE 'x_%' + SELECT COUNT(acard.id) FROM m_actor_card acard WHERE barcode ~* '^x_' @@ -827,7 +827,7 @@ id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3 actors 0 Collision List - SELECT acard.barcode FROM m_actor_card_legacy acard WHERE acard.barcode LIKE 'x_' AND acard.x_migrate = TRUE ORDER BY 1 LIMIT 20 + SELECT acard.barcode FROM m_actor_card_legacy acard WHERE acard.barcode ~* '^x_' AND acard.x_migrate = TRUE ORDER BY 1 LIMIT 20 This is a shortlist of patron barcode collisions that maxes out at 20. If there are more collisions we will need to run a custom report. In some cases we may flag individual accounts to not migrate. @@ -837,7 +837,7 @@ id = ac_sc.owner GROUP BY 2,3 ORDER BY 2,3 actors 1 Collision List - SELECT acard.barcode FROM m_actor_card acard WHERE acard.barcode LIKE 'x_%' ORDER BY 1 LIMIT 20 + SELECT acard.barcode FROM m_actor_card acard WHERE acard.barcode ~* '^x_%' ORDER BY 1 LIMIT 20 This is a shortlist of patron barcode collisions that maxes out at 20. If there are more collisions we will need to run a custom report. In some cases we may flag individual accounts to not migrate. -- 1.7.2.5