{"action":"created","issue":{"url":"https://api.github.com/repos/db-migrate/node-db-migrate/issues/393","repository_url":"https://api.github.com/repos/db-migrate/node-db-migrate","labels_url":"https://api.github.com/repos/db-migrate/node-db-migrate/issues/393/labels{/name}","comments_url":"https://api.github.com/repos/db-migrate/node-db-migrate/issues/393/comments","events_url":"https://api.github.com/repos/db-migrate/node-db-migrate/issues/393/events","html_url":"https://github.com/db-migrate/node-db-migrate/issues/393","id":167523774,"number":393,"title":"Can't use db:create with postgres","user":{"login":"concubicycle","id":4027883,"avatar_url":"https://avatars.githubusercontent.com/u/4027883?v=3","gravatar_id":"","url":"https://api.github.com/users/concubicycle","html_url":"https://github.com/concubicycle","followers_url":"https://api.github.com/users/concubicycle/followers","following_url":"https://api.github.com/users/concubicycle/following{/other_user}","gists_url":"https://api.github.com/users/concubicycle/gists{/gist_id}","starred_url":"https://api.github.com/users/concubicycle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concubicycle/subscriptions","organizations_url":"https://api.github.com/users/concubicycle/orgs","repos_url":"https://api.github.com/users/concubicycle/repos","events_url":"https://api.github.com/users/concubicycle/events{/privacy}","received_events_url":"https://api.github.com/users/concubicycle/received_events","type":"User","site_admin":false},"labels":[{"id":39213807,"url":"https://api.github.com/repos/db-migrate/node-db-migrate/labels/bug","name":"bug","color":"e11d21","default":true},{"id":172552417,"url":"https://api.github.com/repos/db-migrate/node-db-migrate/labels/question","name":"question","color":"d4c5f9","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-26T05:27:44Z","updated_at":"2016-11-22T19:07:07Z","closed_at":null,"body":"Just installed postgres with default settings. Created this config: \n\n```\n{\n  \"defaultEnv\": \"local\",\n  \"local\": {\n    \"driver\": \"pg\",\n    \"user\": \"postgres\",\n    \"password\": [my password],\n    \"host\": \"localhost\",\n    \"database\": \"identity\",\n    \"schema\": \"public\"\n  }\n}\n```\n\nThen tried running \n\n> db-migrate db:create identity\n\n.\n\nGot error: \n\n> [INFO] Detected and using the projects local version of db-migrate. 'D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate\\index.js'\n> [INFO] Using local settings: { driver: 'pg',\n>   user: 'postgres',\n>   password: '******',\n>   host: 'localhost',\n>   database: 'identity',\n>   schema: 'public' }\n> [INFO] require: db-migrate-pg\n> [INFO] connecting\n> [INFO] connected\n> [SQL] CREATE DATABASE \"identity\"\n> [ERROR] error: database \"identity\" does not exist\n>     at Connection.parseE (D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate-pg\\node_modules\\pg\\lib\\connection.js:539:11)\n>     at Connection.parseMessage (D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate-pg\\node_modules\\pg\\lib\\connection.js:366:17)\n>     at Socket.<anonymous> (D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate-pg\\node_modules\\pg\\lib\\connection.js:105:22)\n>     at emitOne (events.js:77:13)\n>     at Socket.emit (events.js:169:7)\n>     at readableAddChunk (_stream_readable.js:153:18)\n>     at Socket.Readable.push (_stream_readable.js:111:10)\n>     at TCP.onread (net.js:531:20)\n\nTried taking out \"database\" \"identity\" from config, and got: \n\n> [INFO] Detected and using the projects local version of db-migrate. 'D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate\\index.js'\n> [INFO] Using local settings: { driver: 'pg',\n>   user: 'postgres',\n>   password: '******',\n>   host: 'localhost',\n>   schema: 'public' }\n> [INFO] require: db-migrate-pg\n> [INFO] connecting\n> [INFO] connected\n> [SQL] CREATE DATABASE \"identity\"\n> [ERROR] error: database \"savel\" does not exist\n>     at Connection.parseE (D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate-pg\\node_modules\\pg\\lib\\connection.js:539:11)\n>     at Connection.parseMessage (D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate-pg\\node_modules\\pg\\lib\\connection.js:366:17)\n>     at Socket.<anonymous> (D:\\Development\\friendswithgoals\\databases\\identity\\node_modules\\db-migrate-pg\\node_modules\\pg\\lib\\connection.js:105:22)\n>     at emitOne (events.js:77:13)\n>     at Socket.emit (events.js:169:7)\n>     at readableAddChunk (_stream_readable.js:153:18)\n>     at Socket.Readable.push (_stream_readable.js:111:10)\n>     at TCP.onread (net.js:531:20)\n\nMigrations seem to be working fine. I was able to manually create db, and run migrations. Just wondering what I'm doing wrong here.\n## <bountysource-plugin>\n\nWant 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).\n</bountysource-plugin>\n"},"comment":{"url":"https://api.github.com/repos/db-migrate/node-db-migrate/issues/comments/262334431","html_url":"https://github.com/db-migrate/node-db-migrate/issues/393#issuecomment-262334431","issue_url":"https://api.github.com/repos/db-migrate/node-db-migrate/issues/393","id":262334431,"user":{"login":"LandonSchropp","id":361591,"avatar_url":"https://avatars.githubusercontent.com/u/361591?v=3","gravatar_id":"","url":"https://api.github.com/users/LandonSchropp","html_url":"https://github.com/LandonSchropp","followers_url":"https://api.github.com/users/LandonSchropp/followers","following_url":"https://api.github.com/users/LandonSchropp/following{/other_user}","gists_url":"https://api.github.com/users/LandonSchropp/gists{/gist_id}","starred_url":"https://api.github.com/users/LandonSchropp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LandonSchropp/subscriptions","organizations_url":"https://api.github.com/users/LandonSchropp/orgs","repos_url":"https://api.github.com/users/LandonSchropp/repos","events_url":"https://api.github.com/users/LandonSchropp/events{/privacy}","received_events_url":"https://api.github.com/users/LandonSchropp/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T19:07:07Z","updated_at":"2016-11-22T19:07:07Z","body":"For anyone who runs into this, my workaround was to create a separate `database_create.json` configuration file that looks like this (without a `database` property):\r\n\r\n```\r\n{\r\n  \"defaultEnv\": \"local\",\r\n  \"local\": {\r\n    \"driver\": \"pg\",\r\n    \"user\": \"postgres\",\r\n    \"password\": [my password],\r\n    \"host\": \"localhost\",\r\n    \"schema\": \"public\"\r\n  }\r\n}\r\n```\r\n\r\nI then run the create command like this:\r\n\r\n```\r\nnode_modules/db-migrate/bin/db-migrate --config database_create.json db:create identity\r\n```"}}
{"actor":{"display_login":"LandonSchropp"}}