0

I'm not a sequelize expert, but I'm working on a project with other people where we're using sequelize with postgres. I'm trying to run a migration using sequelize-cli, but for some reason, the migration just simply won't run, but it also doesn't create any error messages. I just get:

Sequelize CLI [Node: 14.3.0, CLI: 5.5.1, ORM: 5.21.5]
Loaded configuration file "backend/database/config/config.js".
Using environment "dev".
Done in 0.40s.

I'm personally using WSL + Docker Desktop, but I've also tried this on Arch Linux/MacOS. The migrations work on other people's machines, but for some reason, my sequelize just refuses to connect to my postgres on any machine, even if I manually put data into the database and try to have the app connect to the database. We've tried reinstalling the project a few times/running through the installation process with members of the team, but have had no success.

Let me know if there's more I can provide to help!

config.js:


require('dotenv').config();

const dbCert = process.env.dbCertPath ? fs.readFileSync(process.env.dbCertPath) : '';

module.exports = {
  dev: {
    username: 'postgres',
    password: null,
    database: 'searchneu_dev',
    host: '127.0.0.1',
    dialect: 'postgres',
  },
  test: {
    username: 'postgres',
    password: null,
    database: 'searchneu_test',
    host: '127.0.0.1',
    dialect: 'postgres',
    logging: false,
  },
  prod: {
    username: process.env.dbUsername,
    password: process.env.dbPassword,
    database: process.env.dbName,
    host: process.env.dbHost,
    dialect: 'postgres',
    dialectOptions: {
      ssl: {
        rejectUnauthorized: true,
        ca: dbCert,
      },
    },
  },
};
ditao1
  • 11
  • 3
  • have you created `.sequelizerc` file ? – Arpit Vyas Jun 29 '20 at 03:14
  • Yeah, it's `const path = require('path'); const base = process.env.NODE_ENV === 'prod' ? './dist' : './' module.exports = { 'config': path.resolve(base, 'backend', 'database', 'config', 'config.js'), 'models-path': path.resolve(base, 'backend', 'database', 'models'), 'migrations-path': path.resolve(base, 'backend', 'database', 'migrations') }` – ditao1 Jun 29 '20 at 05:15
  • Did you ever find a solution? I'm having the same issue, but on macOS while I have colleagues who are able to run it just fine on macOS. – Vidur Oct 14 '20 at 09:43

0 Answers0