36896-vm/db/migrations/002_add_converted_path_to_streams.php
Flatlogic Bot 48cd368984 cloud
2025-12-12 17:05:57 +00:00

22 lines
615 B
PHP

<?php
require_once __DIR__ . '/../config.php';
try {
$pdo = db();
// Check if the column already exists before trying to add it
$stmt = $pdo->query("SHOW COLUMNS FROM streams LIKE 'converted_path'");
$exists = $stmt->rowCount() > 0;
if (!$exists) {
$sql = "ALTER TABLE streams ADD COLUMN converted_path VARCHAR(255) NULL AFTER status";
$pdo->exec($sql);
echo "Coluna 'converted_path' adicionada com sucesso.\n";
} else {
echo "Coluna 'converted_path' já existe.\n";
}
} catch (PDOException $e) {
die("Erro na migração: " . $e->getMessage());
}