getConnection(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "\n── Migraciones pendientes ──────────────────\n\n"; foreach ($pendientes as $file) { $path = __DIR__ . '/' . $file; if (!file_exists($path)) { echo " ⚠ No encontrado: $file\n"; continue; } try { $pdo->exec(file_get_contents($path)); echo " ✅ $file\n"; } catch (PDOException $e) { // Si ya existe la columna/tabla, no es error crítico $msg = $e->getMessage(); if (str_contains($msg, 'Duplicate column') || str_contains($msg, 'already exists')) { echo " ⏭ $file (ya aplicada)\n"; } else { echo " ❌ $file → $msg\n"; } } } echo "\n── Listo ───────────────────────────────────\n\n";