db-migrate / db-migrate/node-db-migrate

Can't use db:create with postgres

Open
#393 6 comments 1 reaction 0 assignees View on GitHub
bug question
Dominant language
JavaScript
Stars
2.3k
Forks
361
PR merge metrics
No merged PRs in 30d

Description

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!](https://www.bountysource.com/issues/36348106-can-t-use-db-create-with-postgres?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F73887&utm_medium=issues&utm_source=github).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.