<?php

namespace src\Migrations;

class _005_alterarSenhaUsuarioPadrao
{
    public function up()
    {
        $conexao = new \src\Conexao\Conexao();
        $conn = $conexao->getConexao();

        $query = "UPDATE usuario SET senha = 'cce4228aecee37c6a36ba25e8d7fd486' WHERE email = 'contato@modernahost.com.br'";
    
        $stmt = $conn->prepare($query);
        if (!$stmt) {
            echo "Erro ao preparar a consulta: " . $conn->error;
            return null;
        }

        $stmt->execute();
    }

    public function down()
    {
        $conexao = new \src\Conexao\Conexao();
        $conn = $conexao->getConexao();

        $query = "UPDATE usuario SET senha = 'cce4228aecee37c6a36ba25e8d7fd486' WHERE email = 'contato@modernahost.com.br'";

        $stmt = $conn->prepare($query);

        if (!$stmt) {
            echo "Erro ao preparar a consulta: " . $conn->error;
            return null;
        }

        $stmt->execute();
    }
}