Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequelize error message gives no centext #1519

Open
owujib opened this issue Sep 4, 2024 · 0 comments
Open

Sequelize error message gives no centext #1519

owujib opened this issue Sep 4, 2024 · 0 comments

Comments

@owujib
Copy link

owujib commented Sep 4, 2024

I am running sequelize cli and this is the error I get for any command being run

sequelize-cli db:seed:all

Sequelize CLI [Node: 20.17.0, CLI: 6.6.2, ORM: 6.37.3]

Loaded configuration file "server/config/config.js".
Using environment "development".

ERROR: 

My config file:

const { config } = require('dotenv');
const path = require('path');
config({ path: path.resolve('../../.env') });

const DBConfig = {
  development: {
    username: process.env.DEV_DB_USERNAME,
    password: process.env.DEV_DB_PASSWORD,
    database: process.env.DEV_DB_DATABASE,
    port: process.env.DEV_DB_PORT,
    host: process.env.DEV_DB_HOST,
    dialect: process.env.DEV_DB_DIALECT || 'mysql',
    use_env_variable: process.env.DEV_DB_DATABASE_URL,
  },
  test: {
    username: 'root',
    password: '',
    database: 'database_test',
    port: '',
    host: '127.0.0.1',
    dialect: 'mysql',
    use_env_variable: process.env.DATABASE_URL,
  },

  production: {
    username: process.env.DB_USERNAME,
    password: process.env.DB_PASSWORD,
    database: process.env.DB_DATABASE,
    host: process.env.DB_HOST,
    dialect: process.env.DB_DIALECT || 'mysql',
    port: process.env.DB_PORT,
    use_env_variable: process.env.DB_DATABASE_URL,
  },
};

module.exports = DBConfig;

My .sequelizerc file:

const path = require('path');

module.exports = {
  config: path.resolve('server', 'config', 'config.js'),
  'models-path': path.resolve('server', 'models'),
  'seeders-path': path.resolve('server', 'database', 'seeders'),
  'migrations-path': path.resolve('server', 'database', 'migrations'),
};

Please I need help with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant