This is my config.js file
require('dotenv').config();
module.exports = {
test: {
username: process.env.DB_USER_2,
password: process.env.DB_PASS_2,
database: process.env.DB_TABLE,
host: process.env.DB_HOST_2,
dialect: "mysql"
},
production: {
username: process.env.DB_USER_PRODUCTION,
password: process.env.DB_PASS_PRODUCTION,
database: process.env.DB_TABLE_PRODUCTION,
host: process.env.DB_HOST_PRODUCTION,
dialect: "mysql"
}
}
This is my index.js file within my models folder
'use strict';
const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const basename = path.basename(__filename);
const env = process.env.NODE_ENV || 'development';
const config = require(__dirname + '/../config/config.js')[env];
const db = {};
let sequelize;
if (config.use_env_variable) {
console.log(process.env)
sequelize = new Sequelize(process.env[config.use_env_variable], config);
} else {
sequelize = new Sequelize(config.database, config.username, config.password, config);
}
I have a .env file with the current environment of testing, I'm trying to run a migration right now, Right now I emptied the migration file incase anything there was messing up the sequelize. When I run db:migrate:status it throws the error about the database dialect. Does anyone know why the dialect error gets thrown?