<?php

namespace src\Migrations;

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

        $query = "ALTER TABLE proposta ADD CONSTRAINT fk_id_cliente_proposta FOREIGN KEY (id_cliente) REFERENCES cliente(id);";

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

        $stmt->execute();
    }

    public function down() {}
}
