Skip to content

Commit aefa15a

Browse files
committed
Updated make file for delete script
1 parent 5356ed7 commit aefa15a

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

Makefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,22 @@ changelog:
3232
build-changelog changelog.yaml --org PolicyEngine --repo policyengine-api --output CHANGELOG.md --template .github/changelog_template.md
3333
bump-version changelog.yaml setup.py policyengine_api/constants.py
3434
rm changelog_entry.yaml || true
35-
touch changelog_entry.yaml
35+
touch changelog_entry.yaml
36+
37+
DB_NAME=my_local_db
38+
DB_USER=postgres
39+
DB_HOST=localhost
40+
41+
42+
delete-db:
43+
PGPASSWORD=$(PGPASSWORD) dropdb -U $(DB_USER) -h $(DB_HOST) $(DB_NAME) || echo "Database not found."
44+
45+
create-db:
46+
PGPASSWORD=$(PGPASSWORD) createdb -U $(DB_USER) -h $(DB_HOST) $(DB_NAME)
47+
48+
reset-db: delete-db create-db
49+
50+
create-schema:
51+
PGPASSWORD=$(PGPASSWORD) psql -U $(DB_USER) -h $(DB_HOST) -d $(DB_NAME) -f schema.sql
52+
53+
recreate-db: reset-db create-schema

0 commit comments

Comments
 (0)