-- =====================================================
-- MIGRACIÓN: DE first_name + last_name A full_name
-- =====================================================

-- 1. Agregar la nueva columna full_name
ALTER TABLE free_resources_registrations 
ADD COLUMN full_name VARCHAR(200) NOT NULL DEFAULT '' AFTER id;

-- 2. Llenar full_name con los datos existentes
UPDATE free_resources_registrations 
SET full_name = CONCAT(first_name, ' ', last_name)
WHERE full_name = '';

-- 3. Eliminar las columnas viejas
ALTER TABLE free_resources_registrations 
DROP COLUMN first_name,
DROP COLUMN last_name;

-- 4. Verificar la migración
SELECT COUNT(*) as total_registros, 
       COUNT(CASE WHEN full_name != '' THEN 1 END) as con_nombre
FROM free_resources_registrations;