-- Assign Solution Types taxonomy terms to resources
-- ONLY using 3 parent categories:
-- 21: Business Debt Resolution
-- 22: Strategic Business Consulting
-- 23: Customized Financing Solutions

-- Clear ALL existing solution-types assignments
DELETE tr FROM wp_term_relationships tr
INNER JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy = 'solution-types';

-- Insert new term relationships (parent categories only, most appropriate single category per resource)
INSERT INTO wp_term_relationships (object_id, term_taxonomy_id, term_order) VALUES
-- 1587: Article about reorganization exit strategy - debt focused
(1587, 21, 0),
-- 1786: Case study Article 9 restructuring for bank - debt resolution
(1786, 21, 0),
-- 1794: Case study Article 9 restructuring for Chase - debt resolution
(1794, 21, 0),
-- 2598: MCA factor rates education - debt focused
(2598, 21, 0),
-- 2863: Ultimate guide to MCA debt relief - debt focused
(2863, 21, 0),
-- 2865: MCA debt relief video - debt focused
(2865, 21, 0),
-- 3040: Company overview strategic partnership - consulting
(3040, 22, 0),
-- 3045: Debt restructuring services - debt focused
(3045, 21, 0),
-- 3051: Small business debt consolidation - debt focused
(3051, 21, 0),
-- 3056: Debt stalling business - debt focused
(3056, 21, 0),
-- 3060: Corporate turnaround consulting - consulting
(3060, 22, 0),
-- 3934: Personal guarantees in loans - debt focused
(3934, 21, 0),
-- 3975: Heavy Duty Radiator turnaround with secured finance - financing solutions
(3975, 23, 0),
-- 3978: Same case study - financing solutions
(3978, 23, 0),
-- 4011: MCA default consequences - debt focused
(4011, 21, 0),
-- 4053: Norm testimonial MCA - debt focused
(4053, 21, 0),
-- 4064: Ron testimonial MCA - debt focused
(4064, 21, 0),
-- 4075: Confessions of Judgment - debt focused
(4075, 21, 0),
-- 4092: Adaptability strategy - consulting
(4092, 22, 0),
-- 4103: SBA OIC process - debt focused
(4103, 21, 0),
-- 4105: Advisory board importance - consulting
(4105, 22, 0),
-- 4113: 6 Myths of Bankruptcy - debt focused
(4113, 21, 0),
-- 4124: Debt solutions video - debt focused
(4124, 21, 0),
-- 4128: Bloomberg MCA discussion - debt focused
(4128, 21, 0),
-- 4132: TMA CEO MCA discussion - debt focused
(4132, 21, 0),
-- 4138: There's a Better Way video - debt focused
(4138, 21, 0),
-- 4144: Second Wind mission - debt focused
(4144, 21, 0),
-- 4154: Bankruptcy alternatives - debt focused
(4154, 21, 0),
-- 4157: Article 9 for ABL lenders - financing solutions
(4157, 23, 0),
-- 4160: BOK distressed note exit - financing solutions
(4160, 23, 0),
-- 4163: ABL bank take-out ecosystem - financing solutions
(4163, 23, 0),
-- 4167: Handaband USA secured lending - financing solutions
(4167, 23, 0),
-- 4186: Hidden dangers of debt relief - debt focused
(4186, 21, 0),
-- 4225: Leadership delegation - consulting
(4225, 22, 0),
-- 4284: Debt settlement trap - debt focused
(4284, 21, 0),
-- 4311: MCA UCC 9-406 abuse - debt focused
(4311, 21, 0),
-- 4328: MCA reconciliation rights abuse - debt focused
(4328, 21, 0),
-- 4339: MCA debt relief truth - debt focused
(4339, 21, 0),
-- 4343: MCA debt relief firms guide - debt focused
(4343, 21, 0),
-- 4356: Business inspections - consulting
(4356, 22, 0),
-- 4375: Running your business - consulting
(4375, 22, 0),
-- 4405: Namco Article 9 restructuring - financing solutions
(4405, 23, 0),
-- 4412: Flatten the pyramid - consulting
(4412, 22, 0),
-- 4420: Art of inspection - consulting
(4420, 22, 0),
-- 4425: Flat management practices - consulting
(4425, 22, 0),
-- 4464: Article 9 restructuring modern approach - financing solutions
(4464, 23, 0),
-- 4474: Tariff impacts on lenders - financing solutions
(4474, 23, 0),
-- 4499: Restructuring heat map - debt focused
(4499, 21, 0),
-- 4504: MCA distress secured finance opportunity - financing solutions
(4504, 23, 0);

-- Update term counts
UPDATE wp_term_taxonomy tt
SET count = (
    SELECT COUNT(*) FROM wp_term_relationships tr
    WHERE tr.term_taxonomy_id = tt.term_taxonomy_id
)
WHERE tt.taxonomy = 'solution-types';
