mirror of
https://github.com/freedbygrace/SQL.git
synced 2026-07-26 11:28:16 +00:00
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:
@@ -113,15 +113,15 @@ INSERT INTO merchant_categories (category_code, category_name, description, risk
|
||||
('7991', 'Tourist Attractions', 'Tourist attractions and exhibits', 0.75),
|
||||
('7995', 'Gambling', 'Betting and casino gambling', 2.50),
|
||||
('5816', 'Digital Goods', 'Digital goods and games', 1.80),
|
||||
('5967', 'Direct Marketing', 'Direct marketing and inbound telemarketing', 1.90),
|
||||
('5966', 'Direct Marketing', 'Outbound telemarketing merchants', 2.00),
|
||||
('5967', 'Direct Marketing Inbound', 'Direct marketing and inbound telemarketing', 1.90),
|
||||
('5966', 'Direct Marketing Outbound', 'Outbound telemarketing merchants', 2.00),
|
||||
('6051', 'Cryptocurrency', 'Cryptocurrency and digital currency', 3.00),
|
||||
('6211', 'Securities', 'Securities brokers and dealers', 1.50),
|
||||
('6300', 'Insurance', 'Insurance sales and underwriting', 1.20),
|
||||
('6513', 'Real Estate', 'Real estate agents and managers', 1.30),
|
||||
('7273', 'Dating Services', 'Dating and escort services', 2.20),
|
||||
('7297', 'Massage Parlors', 'Massage parlors', 2.50),
|
||||
('7995', 'Online Gambling', 'Online gambling and betting', 3.50),
|
||||
('7996', 'Online Gambling', 'Online gambling and betting', 3.50),
|
||||
('5094', 'Precious Metals', 'Precious stones and metals', 2.80),
|
||||
('5933', 'Pawn Shops', 'Pawn shops', 2.60),
|
||||
('5960', 'Mail Order', 'Direct marketing and mail order', 1.70),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user