https://github.com/moi-solutions/db-fork
Script to automate the creation of a database based on a template in Postgres
https://github.com/moi-solutions/db-fork
bash postgres
Last synced: about 2 months ago
JSON representation
Script to automate the creation of a database based on a template in Postgres
- Host: GitHub
- URL: https://github.com/moi-solutions/db-fork
- Owner: moi-solutions
- License: apache-2.0
- Created: 2017-07-26T16:11:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-10T16:06:29.000Z (over 8 years ago)
- Last Synced: 2025-03-02T12:19:27.158Z (over 1 year ago)
- Topics: bash, postgres
- Language: Shell
- Size: 7.81 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# db-fork
Script to automate the creation of a database based on a template in Postgres.
> Only works if postgres does not have a password.
## Environment variables
POSTGRES_BIN_PATH // /Applications/Postgres.app/Contents/Versions/9.6/bin/
POSTGRES_BIN_NAME // createdb
POSTGRES_DATABASE_TEMPLATE_NAME // development
POSTGRES_DATABASE_HOST // localhost
POSTGRES_DATABASE_USERNAME // postgres
## Remote call (using default variable)
$ wget -qO- https://raw.githubusercontent.com/moi-solutions/db-fork/1.1/createdb.sh | bash
## Hook (Optional)
This hook call before command on **git checkout**.
> Call this command on root path from local repository.
cd .git/hooks/ && wget -O post-checkout https://git.io/v7s7X && chmod +x post-checkout && cd ../../