ALTER TABLE finanto_inss_cases
    ADD COLUMN loan_proposal_id INT UNSIGNED NULL AFTER integration_id,
    ADD COLUMN borrower_birth_date DATE NULL AFTER borrower_cpf,
    ADD COLUMN borrower_father VARCHAR(150) NULL AFTER borrower_mother;

ALTER TABLE finanto_inss_cases
    ADD CONSTRAINT fk_finanto_case_proposal FOREIGN KEY (loan_proposal_id) REFERENCES loan_proposals (id) ON DELETE SET NULL;

ALTER TABLE finanto_inss_cases
    ADD INDEX idx_finanto_case_proposal (loan_proposal_id);
