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

Ignoring invalid configuration option passed to Connection: driver #753

Open
erkage opened this issue Sep 25, 2021 · 3 comments
Open

Ignoring invalid configuration option passed to Connection: driver #753

erkage opened this issue Sep 25, 2021 · 3 comments

Comments

@erkage
Copy link

erkage commented Sep 25, 2021

Hi,

Can't figure out why i'm getting this msg when running pnpm db-migrate up:
Ignoring invalid configuration option passed to Connection: driver

My database.json is:

{
  "dev": {
    "driver": "mysql",
    "host": "localhost",
    "port": "3306",
    "user": "root",
    "password": "",
    "database": "graphql-mysql-test"
  }
}

migration js is genereated with pnpm db-migrate create user :

...
exports.up = function(db, callback) {
  db.createTable('user', {
    id: {
      type: 'int',
      primaryKey: true
    },
    full_name: {
      type: 'string',
      length: 40
    },
    dob: {
      type: 'date'
    },
    email: {
      type: 'string',
      length: 50
    },
  }, function(err) {
    if (err) return callback(err);
    return callback();
  });
};
...

Versions:
"db-migrate": "^1.0.0-beta.16",
"db-migrate-mysql": "^2.2.0",
node: v14.17.3

@rriopel432
Copy link

This is actually coming from mysql's createConnection, not db-migrate. In your case, the dev configuration is passed directly to mysql's createConnection. createConnection isn't expecting the driver value so it complains. This would have to be fixed in db-migrate-mysql, not db-migrate.

@vipulwairagade
Copy link

@erkage were you able to fix this issue ? I'm also facing same issue.

@GiveMeMoreKnowledge
Copy link

@erkage вы смогли исправить эту проблему? Я также сталкиваюсь с той же проблемой.

You can fix this issue just add in node_modules/db-migrate-mysql/index.js
exports.connect = function (config, intern, callback) {
delete config.driver
.....
}

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

4 participants