Friday, August 3, 2018

dump/export heroku database

You could just make your own pg_dump directly from your Heroku database.
First, get your postgres string using heroku config:get DATABASE_URL.
Look for the Heroku Postgres url (example: HEROKU_POSTGRESQL_RED_URL: postgres://user3123:passkja83kd8@ec2-117-21-174-214.compute-1.amazonaws.com:6212/db982398), which format is postgres://<username>:<password>@<host_name>:<port>/<dbname>.
Next, run this on your command line:
pg_dump --host=<host_name> --port=<port> --username=<username> --password <dbname> > output.sql
OR
pg_dump <heroku postgres string> > output.sql
The terminal will ask for your password then run it and dump it into output.sql.
Then import it: to your localhost db
psql -d my_local_database -f output.sql

Thursday, August 2, 2018

Putting local Postregsql database in Heroku

Grab your the postgres string from your Heroku database using heroku config:get DATABASE

Look for the Heroku Postgres url (example: HEROKU_POSTGRESQL_RED_URL: postgres://user3123:passkja83kd8@ec2-117-21-174-214.compute-1.amazonaws.com:6212/db982398), which format is postgres://<username>:<password>@<host_name>:<port>/<dbname>.

Then import it:
psql -d <heroku postgres string> -f output.sql
Note: in each place where you see <.....> in the above code, be sure to substitute your specific information. Thus you would put your username where it says <username>, and your heroku database url where it says <heroku postgres string>.

Product Category Demo in laravel

https://drive.google.com/file/d/1kuyeT3LA22IuN3o_kypOyXesEXMLv31e/view?usp=sharing