Skip to content

Delete script for deleting the local database #2562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@ changelog:
build-changelog changelog.yaml --org PolicyEngine --repo policyengine-api --output CHANGELOG.md --template .github/changelog_template.md
bump-version changelog.yaml setup.py policyengine_api/constants.py
rm changelog_entry.yaml || true
touch changelog_entry.yaml
touch changelog_entry.yaml

# Configurable variables with defaults (can be overridden at runtime)
DB_NAME ?= your_database_name
DB_USER ?= your_username
DB_HOST ?= localhost
DB_PORT ?= 5432

# Drop the PostgreSQL database
delete-local-db:
@echo "Dropping database '$(DB_NAME)'..."
@PGPASSWORD=$$PGPASSWORD dropdb -U $(DB_USER) -h $(DB_HOST) -p $(DB_PORT) $(DB_NAME) || echo "Failed to drop database or database does not exist."

4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
added:
- Updates to makefile for a script to delete local database
Loading