diff --git a/migrations/20260626_activar_numero_turnero.php b/migrations/20260626_activar_numero_turnero.php new file mode 100644 index 0000000..2cfb25a --- /dev/null +++ b/migrations/20260626_activar_numero_turnero.php @@ -0,0 +1,16 @@ +getMessage() . "\n"; + exit(1); +} diff --git a/migrations/20260626_turnero_canal_conversations.sql b/migrations/20260626_turnero_canal_conversations.sql new file mode 100644 index 0000000..f5b0f49 --- /dev/null +++ b/migrations/20260626_turnero_canal_conversations.sql @@ -0,0 +1,9 @@ +-- Migración: agregar columna `canal` a la tabla conversations +-- Permite distinguir mensajes del bot (canal='bot') del turnero (canal='turnero') +-- Todos los registros existentes quedan como 'bot' (sin pérdida de datos) + +ALTER TABLE `conversations` + ADD COLUMN IF NOT EXISTS `canal` VARCHAR(20) NOT NULL DEFAULT 'bot' AFTER `status`; + +ALTER TABLE `conversations` + ADD INDEX IF NOT EXISTS `idx_conversations_canal` (`canal`);