Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digipie/psql-heroku-buildpack
Heroku buildpack which executes a PostgreSQL script file on deployment to Heroku.
https://github.com/digipie/psql-heroku-buildpack
heroku heroku-buildpack postgresql
Last synced: 12 days ago
JSON representation
Heroku buildpack which executes a PostgreSQL script file on deployment to Heroku.
- Host: GitHub
- URL: https://github.com/digipie/psql-heroku-buildpack
- Owner: DigiPie
- License: mit
- Created: 2019-09-25T05:00:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-25T05:50:54.000Z (about 5 years ago)
- Last Synced: 2024-10-24T08:12:26.568Z (2 months ago)
- Topics: heroku, heroku-buildpack, postgresql
- Language: Shell
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# psql-heroku-buildpack
### Purpose
This buildpack executes a PostgreSQL script file on deployment to Heroku.### Example use-case
You are developing a NodeJS-PostgreSQL application on Github with automatic deployment to Herokuapp whenever there is a commit to the `master` branch. You would like your `setup.sql` file to be executed each time this deployment occurs in order to reset all data (re-create and re-populate tables) in the **PostgreSQL database add-on attached to your Herokuapp project.**### How to add this buildpack
1. Open your app project's **Settings** page.
2. Under the **Buildpacks** section, add this buildpack: `https://github.com/DigiPie/psql-heroku-buildpack`
3. Under the **Config Vars** section, [set the following config variables](https://devcenter.heroku.com/articles/config-vars):- `DATABASE_URL` : postgres://[username]:[password]@[host address]:[port]/[database name]
- `SETUP_SQL` : [filename].sql#### Example
- `DATABASE_URL` : postgres://johntan:[email protected]:5432/studentDB
- `SETUP_SQL` : setup.sql#### More info
The `DATABASE_URL` for your **PostgreSQL database add-on** can be accessed at the **Settings > View Credentials...** section of your add-on administration page. [Find out more here](https://devcenter.heroku.com/articles/heroku-postgresql-credentials).