Skip to content

Can't use db:create with postgres #393

Open
@walnutfalls

Description

@walnutfalls

Just 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. (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. (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.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions