<?php

namespace src\Migrations;

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

        $query = "ALTER TABLE financeiro ADD CONSTRAINT fk_id_cliente 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() {}
}
