forked from ZU-Hospital/zu-hospital-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9c54c6
commit fb6fd52
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# project/app_name/management/commands/test_db_destroy.py | ||
|
||
from django.core.management.base import BaseCommand | ||
from django.db import connections | ||
|
||
class Command(BaseCommand): | ||
help = 'Destroy the test database' | ||
|
||
def handle(self, *args, **options): | ||
connection = connections['default'] | ||
cursor = connection.cursor() | ||
cursor.execute('DROP DATABASE IF EXISTS test_hospital') | ||
self.stdout.write(self.style.SUCCESS('Test database destroyed successfully.')) | ||
print("Test database destroyed successfully.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters