26 lines
738 B
PHP
26 lines
738 B
PHP
<?php
|
|
/**
|
|
* Migración: crea tabla lab_domicilio_notas
|
|
* Ejecutar: php migrations/run_20260325_notas.php
|
|
*/
|
|
require_once __DIR__ . '/../config/config.php';
|
|
require_once __DIR__ . '/../classes/Database.php';
|
|
|
|
$db = Database::getInstance()->getConnection();
|
|
$sql = file_get_contents(__DIR__ . '/20260325_lab_12_domicilio_notas.sql');
|
|
|
|
// Ejecutar la sentencia CREATE TABLE
|
|
try {
|
|
$db->exec($sql);
|
|
echo "✅ Tabla lab_domicilio_notas creada correctamente.\n";
|
|
} catch (PDOException $e) {
|
|
if (str_contains($e->getMessage(), 'already exists')) {
|
|
echo "⚠️ La tabla ya existe (omitido).\n";
|
|
} else {
|
|
echo "❌ ERROR: " . $e->getMessage() . "\n";
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
echo "Migración completada.\n";
|