This repository has been archived by the owner on Jan 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
better db/table create docs #142
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,13 +27,30 @@ npm install | |
|
||
# copy default environment config | ||
cp env.sample .env | ||
``` | ||
|
||
You will then also need to create a database and set up the table definitions. | ||
|
||
If you have installed PostgreSQL in a way that works without requiring a username and password, use: | ||
|
||
``` | ||
# create a database; -U and -W are only necessary if your pg instance needs authentication | ||
createdb webmaker | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to show |
||
|
||
# create tables; -U and -W are only necessary if your pg instance needs authentication | ||
psql -d webmaker -f scripts/create-tables.sql | ||
``` | ||
|
||
If you installed PostgreSQL in such a way as to require a username and password, use: | ||
|
||
``` | ||
# create a database; -U and -W are only necessary if your pg instance needs authentication | ||
createdb -U dbusername -W dbuserpassword webmaker | ||
createdb -U dbusername webmaker | ||
|
||
# create tables; -U and -W are only necessary if your pg instance needs authentication | ||
psql -U dbusername -W dbuserpassword -d webmaker -f scripts/create-tables.sql | ||
psql -U dbusername -d webmaker -f scripts/create-tables.sql | ||
``` | ||
If you did, note that both these commands will require you to type in your password. If you want your password to be automatically picked up by psql utilities, you can define an environment variable `PGPASSWORD` and set this to your password (but this really only makes sense if you only use psql for dev/testing purposes) | ||
|
||
### Note: this will set up an empty database | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-W
forces the password prompt, but you'll get that on a passworded account anyway, so we can omit it from the instructions.