class Tabelas { init(conexao){ this.conexao = conexao
this.criarAtendimento();
} criarAtendimento(){ const sql = 'CREATE TABLE Atendimentos (id int NOT NULL AUTO_INCREMENT, cliente varchat(50) NOT NULL, pet varchar(20), servico varchar(20) NOT NULL, status varchar(20) NOT NULL, observacoes text, PRIMARY KEY(id))'
this.conexao.query(sql, erro => {
if(erro){
console.log(erro)
} else {
console.log('Tabela atendimentos criada com Sucesso!')
}
})
}
}
module.exports = new Tabelas
TERMINAL: sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchat(50) NOT NULL, pet varchar(20), servico varchar(20) NOT NULL, status varc' at line 1", sqlState: '42000', index: 0, sql: 'CREATE TABLE Atendimentos (id int NOT NULL AUTO_INCREMENT, cliente varchat(50) NOT NULL, pet varchar(20), servico varchar(20) NOT NULL, status varchar(20) NOT NULL, observacoes text, PRIMARY KEY(id))'