-- Active: 1769448323071@@rocasamexico.com@3306@rocasamexico_pruebas
CREATE TABLE recomendados (
    id INT AUTO_INCREMENT PRIMARY KEY,
    id_aspirante INT NOT NULL,
    id_recomendador VARCHAR(18) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
    id_reclutador INT NOT NULL,
    UNIQUE KEY uk_recomendados_aspirante (id_aspirante),
    FOREIGN KEY (id_aspirante) REFERENCES aspirantes(id) ON DELETE CASCADE,
    FOREIGN KEY (id_recomendador) REFERENCES Plantilla(CURP) ON DELETE CASCADE,
    FOREIGN KEY (id_reclutador) REFERENCES reclutadores(id) ON DELETE CASCADE
);

ALTER TABLE recomendados
ADD COLUMN created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP;

ALTER TABLE recomendados
ADD COLUMN aprovado TINYINT(1) DEFAULT 0;

ALTER TABLE recomendados
ADD COLUMN puesto VARCHAR(255) DEFAULT NULL;