diff --git a/run_003_turnero.php b/run_003_turnero.php index 28834a5..9f10eac 100644 --- a/run_003_turnero.php +++ b/run_003_turnero.php @@ -9,9 +9,11 @@ * https://tu-dominio/run_003_turnero.php */ +// Cargar config primero para que MIGRATION_TOKEN esté disponible +require_once __DIR__ . '/config/config.php'; + // Ejecutar solo desde CLI o con token de protección básica en web if (php_sapi_name() !== 'cli') { - // En web: exigir token para evitar ejecuciones accidentales $token = $_GET['token'] ?? ''; if (empty($token) || $token !== (defined('MIGRATION_TOKEN') ? MIGRATION_TOKEN : '')) { http_response_code(403); @@ -19,8 +21,6 @@ if (php_sapi_name() !== 'cli') { } } -require_once __DIR__ . '/config/config.php'; - $sqlFile = __DIR__ . '/migrations/003_turnero.sql'; if (!file_exists($sqlFile)) {