<?php
use Phinx\Migration\AbstractMigration;
class ReplaceCharsInBanhist extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up(): void
{
$this->execute("UPDATE banhist SET reason = replace(`reason`, '&', '&')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '"', '\"')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, ''', \"'\")");
$this->execute("UPDATE banhist SET reason = replace(`reason`, ''', \"'\")");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '$', '$')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '\', '\\\')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '|', '|')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '^', '^')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '`', '`')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '%', '%')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, ':', ':')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '@', '@')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '<', '<')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '>', '>')");
}
/**
* Migrate Down.
*/
public function down(): void
{
$this->execute("UPDATE banhist SET reason = replace(`reason`, '&', '&')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '\"', '"')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, \"'\", ''')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '<', '<')");
$this->execute("UPDATE banhist SET reason = replace(`reason`, '>', '>')");
}
}