-- Step 1: Add the category_id column to test_fields table
ALTER TABLE test_fields 
ADD COLUMN category_id INT NULL AFTER test_type_id;

-- Step 2: Add foreign key constraint to link with test_categories
ALTER TABLE test_fields 
ADD CONSTRAINT fk_test_fields_category 
FOREIGN KEY (category_id) REFERENCES test_categories(id) ON DELETE CASCADE;
