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