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