Can't use db:create with postgres
See original GitHub issueJust installed postgres with default settings. Created this config:
{
"defaultEnv": "local",
"local": {
"driver": "pg",
"user": "postgres",
"password": [my password],
"host": "localhost",
"database": "identity",
"schema": "public"
}
}
Then tried running
db-migrate db:create identity
.
Got error:
[INFO] Detected and using the projects local version of db-migrate. ‘D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate\index.js’ [INFO] Using local settings: { driver: ‘pg’, user: ‘postgres’, password: ‘******’, host: ‘localhost’, database: ‘identity’, schema: ‘public’ } [INFO] require: db-migrate-pg [INFO] connecting [INFO] connected [SQL] CREATE DATABASE “identity” [ERROR] error: database “identity” does not exist at Connection.parseE (D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate-pg\node_modules\pg\lib\connection.js:539:11) at Connection.parseMessage (D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate-pg\node_modules\pg\lib\connection.js:366:17) at Socket.<anonymous> (D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate-pg\node_modules\pg\lib\connection.js:105:22) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at readableAddChunk (_stream_readable.js:153:18) at Socket.Readable.push (_stream_readable.js:111:10) at TCP.onread (net.js:531:20)
Tried taking out “database” “identity” from config, and got:
[INFO] Detected and using the projects local version of db-migrate. ‘D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate\index.js’ [INFO] Using local settings: { driver: ‘pg’, user: ‘postgres’, password: ‘******’, host: ‘localhost’, schema: ‘public’ } [INFO] require: db-migrate-pg [INFO] connecting [INFO] connected [SQL] CREATE DATABASE “identity” [ERROR] error: database “savel” does not exist at Connection.parseE (D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate-pg\node_modules\pg\lib\connection.js:539:11) at Connection.parseMessage (D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate-pg\node_modules\pg\lib\connection.js:366:17) at Socket.<anonymous> (D:\Development\friendswithgoals\databases\identity\node_modules\db-migrate-pg\node_modules\pg\lib\connection.js:105:22) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at readableAddChunk (_stream_readable.js:153:18) at Socket.Readable.push (_stream_readable.js:111:10) at TCP.onread (net.js:531:20)
Migrations seem to be working fine. I was able to manually create db, and run migrations. Just wondering what I’m doing wrong here.
<bountysource-plugin>Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top GitHub Comments
For anyone who runs into this, my workaround was to create a separate
database_create.json
configuration file that looks like this (without adatabase
property):I then run the create command like this:
Would love to see this fixed in core, following the docs in order and then trying to create a db leads to this error