It seems db-migrate is completely ignoring the project's .db-migraterc. What am I doing wrong?
Based on what was discussed in #451 and #698: Is this feature really working? If it is, what are the supported properties for .db-migraterc?
Also: how does it merge .db-migraterc and database.json, exactly? The documentation doesn't enter in much details about that, so I just assumed anything that I put in database.json, or in any of the environments, could be put in .db-migraterc to be used as defaults.
Expected behavior
It should load all configurations in .db-migraterc, and merge with those in configFile (or database.json, if it's not specified).
Minimal reproduction of the problem with instructions
APP_ENV=local
# Rest of the .env file contains the APP_DB_ variables referenced in database.json
Result of calling db-migrate:
flisboac@REDACTED:~/workspaces/REDACTED$ npx dotenv-cli -e .env.local db-migrate create baseline --sql-file
npx: installed 10 in 1.471s
[ERROR] uncaughtException
[ERROR] Error: Environment(s) 'dev, development' not found.
at Config.exports.setCurrent (/home/flisboac/workspaces/REDACTED/node_modules/db-migrate/lib/config.js:23:11)
at Object.exports.loadObject (/home/flisboac/workspaces/REDACTED/node_modules/db-migrate/lib/config.js:188:9)
at Object.exports.loadFile (/home/flisboac/workspaces/REDACTED/node_modules/db-migrate/lib/config.js:94:18)
at loadConfig (/home/flisboac/workspaces/REDACTED/node_modules/db-migrate/lib/commands/helper/load-config.js:12:18)
at new dbmigrate (/home/flisboac/workspaces/REDACTED/node_modules/db-migrate/api.js:81:43)
at Object.module.exports.getInstance (/home/flisboac/workspaces/REDACTED/node_modules/db-migrate/index.js:84:10)
at /home/flisboac/workspaces/REDACTED/node_modules/db-migrate/bin/db-migrate:32:25
at /home/flisboac/workspaces/REDACTED/node_modules/resolve/lib/async.js:133:25
at maybeRealpath (/home/flisboac/workspaces/REDACTED/node_modules/resolve/lib/async.js:41:9)
at /home/flisboac/workspaces/REDACTED/node_modules/resolve/lib/async.js:129:24
at ondir (/home/flisboac/workspaces/REDACTED/node_modules/resolve/lib/async.js:309:27)
at onex (/home/flisboac/workspaces/REDACTED/node_modules/resolve/lib/async.js:201:32)
at /home/flisboac/workspaces/REDACTED/node_modules/resolve/lib/async.js:13:20
at FSReqCallback.oncomplete (fs.js:193:5)
And even if I just put "defaultEnv": "local" in database.json, it completely ignores the migrationsDir configuration, and just creates a migration in the migrations folder instead, at the root of my project.
What is the motivation / use case for changing the behavior?
No behaviour change is being proposed.
Environment
db-migrate version: 1.0.0-beta.16
plugins with versions: (none)
db-migrate driver with versions:
db-migrate-mysql: 2.2.0 (not that it would make much difference, but here it goes!)
Additional information:
Node version: v14.17.5
Platform: Linux (WSL2)
Others:
flisboac@REDACTED:~/workspaces/REDACTED$ uname -a
Linux REDACTED 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
I'm submitting a...
Current behavior
It seems
db-migrate
is completely ignoring the project's.db-migraterc
. What am I doing wrong?Based on what was discussed in #451 and #698: Is this feature really working? If it is, what are the supported properties for
.db-migraterc
?Also: how does it merge
.db-migraterc
anddatabase.json
, exactly? The documentation doesn't enter in much details about that, so I just assumed anything that I put indatabase.json
, or in any of the environments, could be put in.db-migraterc
to be used as defaults.Expected behavior
It should load all configurations in
.db-migraterc
, and merge with those inconfigFile
(ordatabase.json
, if it's not specified).Minimal reproduction of the problem with instructions
Follows my configuration:
Contents of
.db-migraterc
:Contents of
database.json
:Contents of
.env.local
:Result of calling db-migrate:
And even if I just put
"defaultEnv": "local"
indatabase.json
, it completely ignores themigrationsDir
configuration, and just creates a migration in themigrations
folder instead, at the root of my project.What is the motivation / use case for changing the behavior?
No behaviour change is being proposed.
Environment
Additional information:
Others: