Update run_003_turnero.php

This commit is contained in:
Lizandro Guarnizo
2026-04-19 21:14:45 -05:00
parent 0d17328fc3
commit 0babb3c44a
+3 -3
View File
@@ -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)) {