Error:
Error connecting to database error: column "passworddoctor" of relation "medico" does not exist
at C:\Users\willa\OneDrive\Área de Trabalho\Projetos e cursos\projeto-agenda\agenda-back-end\node_modules\pg\lib\client.js:526:17
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async exports.query (C:\Users\willa\OneDrive\Área de Trabalho\Projetos e cursos\projeto-agenda\agenda-back-end\src\database\index.js:34:24)
at async DoctorsRepository.create (C:\Users\willa\OneDrive\Área de Trabalho\Projetos e cursos\projeto-agenda\agenda-back-end\src\app\repositories\doctorsRepository.js:16:18)
at async store (C:\Users\willa\OneDrive\Área de Trabalho\Projetos e cursos\projeto-agenda\agenda-back-end\src\app\controllers\doctorController.js:44:20) {
length: 133,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '60',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_target.c',
line: '1061',
routine: 'checkInsertTargets'
}
Schema:
CREATE TABLE IF NOT EXISTS medico (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
nome VARCHAR NOT NULL,
especialidade VARCHAR(50) NOT NULL,
crm VARCHAR(20) NOT NULL,
email VARCHAR,
passwordDoctor VARCHAR,
authLevel smallint
);
Query:
async create({
nome, especialidade, crm, email, passwordDoctor, authLevel,
}) {
const rows = await database.query(`
INSERT INTO medico(nome, especialidade, crm, email, passwordDoctor, authlevel)
VALUES($1, $2, $3, $4, $5, $6)
RETURNING *
`, [nome, especialidade, crm, email, passwordDoctor, authLevel]);
return rows;
}
Even the fields independent of all uppercase or lowercase, it does not find the passwordDoctor column in the medico table.
I've tried putting passwordDoctor all in lowercase, but it's no use.