-- First, update any empty strings to 'INDIVIDUAL'
UPDATE `users` SET `userType` = 'INDIVIDUAL' WHERE `userType` = '' OR `userType` IS NULL;

-- Then modify the column to be NOT NULL with a default value
ALTER TABLE `users` 
MODIFY COLUMN `userType` ENUM('INDIVIDUAL', 'ORGANIZATION') NOT NULL DEFAULT 'INDIVIDUAL';

-- Verify the changes
SHOW COLUMNS FROM `users` LIKE 'userType';

-- Show the updated distribution of userType values
SELECT userType, COUNT(*) as count FROM `users` GROUP BY userType;
