db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 360 forks source link

postgres driver looking for sqlite3 #807

Closed jbenjoy2 closed 1 year ago

jbenjoy2 commented 1 year ago

I'm submitting a...

Current behavior

I'm currently running node version 16.13.0 on MacOS 12.6. I have a project with the following dependencies (among others):
"db-migrate": "^0.11.13", "db-migrate-pg": "^1.2.2", "dotenv": "^16.0.1", "express": "^4.17.3", "express-sslify": "^1.2.0", "jsonwebtoken": "^8.5.1", "pg": "^8.7.3"

I have a database.json file that looks like this: { "dev": { "driver": "pg", "host": "localhost", "port": 5432, "database": { "ENV": "DATABASE_URL" } }, "test": { "driver": "pg", "host": "localhost", "port": 5432, "database": { "ENV": "TEST_DATABASE_URL" } } }

When i run the command db-migrate up --config ./database.json -e dev or db-migrate up --config database.json -e dev, i get the following error: AssertionError [ERR_ASSERTION]: ifError got unwanted exception: No such driver found, please try to install it via npm install db-migrate-sqlite3 or npm install -g db-migrate-sqlite3

Expected behavior

This should run with no issues/references to sqlite3. I am defining the driver to be 'pg', and i have not defined the use of sqlite ANYWHERE in my code.

Minimal reproduction of the problem with instructions

  1. Download the db-migrate library and the db-migrate-pg driver
  2. create a new migration and try to run the up command

    What is the motivation / use case for changing the behavior?

    Not being able to run migrations in postgres defeats the purpose of this library altogether.

Environment


db-migrate version: ^0.11.13"
plugins with versions: X.Y.Z
db-migrate driver with versions: db-migrate-pg: ^1.2.2"

Additional information:
- Node version: 16.13.0  
- Platform:   macOS 12.6

Others:

wzrdtales commented 1 year ago

little late, just noting. can't be reproduced, was probably a faulty database.json or scope config.

closing here for now, feel free to reopen if this is still an issue.