-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnote.txt
More file actions
47 lines (31 loc) · 1.25 KB
/
note.txt
File metadata and controls
47 lines (31 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
adding "pg" dependency in package.json
> "pg": "2.x"
in code
> var pg = require('pg');
create heroku
> heroku create
push to heroku
> git push heroku
add Heroku Postgres Starter Tier dev database
> heroku addons:add heroku-postgresql:dev
view available databases
> heroku config | grep HEROKU_POSTGRESQL
promote database to DATABASE_URL
> heroku pg:promote HEROKU_POSTGRESQL_RED_URL
------------------------------------------------------------------------------------------
Set up Postgres.app on Mac
------------------------------------------------------------------------------------------
1. download and install from http://postgresapp.com/
2. add PATH
> PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"
------------------------------------------------------------------------------------------
pull remote data from a Heroku Postgres database to a database on your local machine
------------------------------------------------------------------------------------------
1. connect to Heroku PostgreSQL database
> heroku pg:psql
2. pull database from app_name to local_db_name
> heroku pg:pull HEROKU_POSTGRESQL_MAGENTA local_db_name --app app_name
or
> heroku pg:pull app_name::MAGENTA local_db_name
can reset database
> heroku pg:reset DATABASE