22 lines
615 B
PHP
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());
|
|
}
|
|
|