Fix merchant categories duplicate key and fraud_types query column names

MERCHANT CATEGORIES FIX:

- Fixed duplicate category_code '7995' (Gambling vs Online Gambling)

- Changed Online Gambling code from '7995' to '7996'

- Fixed duplicate 'Direct Marketing' names to be unique

- Changed to 'Direct Marketing Inbound' and 'Direct Marketing Outbound'

- This was causing UNIQUE constraint violation preventing merchant_categories from loading

FRAUD TYPES QUERY FIX:

- Fixed column names in verification query

- Changed from fraud_type_code to fraud_code

- Changed from fraud_type_name to fraud_name

- Matches actual table schema in 01-create-tables.sql

IMPACT:

- Merchant categories will now load correctly (33 categories)

- Fraud types verification query will work without errors

- Setup script will complete all 5 verification queries successfully
This commit is contained in:
Alphaeus Mote
2025-10-24 12:25:43 -04:00
parent 75fa7e0159
commit 730553bffd
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ echo ""
# Query 4: Show fraud types
echo -e "${YELLOW}[4/5] Fraud types:${NC}"
execute_sql "SELECT fraud_type_code, fraud_type_name, severity FROM fraud_types ORDER BY severity DESC, fraud_type_name;"
execute_sql "SELECT fraud_code, fraud_name, severity FROM fraud_types ORDER BY severity DESC, fraud_name;"
echo ""
# Query 5: Show customer segments