Quando tento inserir no terminal 'node api/banco-de-dados/createTable.js' ele exibe: Error: Dialect needs to be explicitly supplied as of v4.0.0
createTable.js abaixo
const TableModel = require('../routes/provider/ProviderModelTable')
TableModel
.sync()
.then(() => console.log('tabela criada com sucesso'))
.catch(console.log)
providermodeltable.js abaixo
const Sequelize = require('sequelize')
const instance = require('../../banco-de-dados')
const column = {
company: {
type: Sequelize.STRING,
allowNull: false
},
email: {
type: Sequelize.STRING,
allowNull: false
},
category: {
type:Sequelize.ENUM('racao', 'brinquedos'),
allowNull: false
}
}
const options ={
freezeTableName: true,
tableName: provider,
timestamps: true,
createdAt: 'dataCriacao',
updatedAt: 'dataAtualizacao',
version: 'versao'
}
module.exports = instance.define('provider', column, options)
/config/default.json abaixo:
{
"mysql":{
"banco-de-dados": "petshop",
"user": "root",
"password": "",
"host": "127.0.0.1",
"dialect": "mysql",
},
"api": {
"port": 3000
}
}