From 8e9e04b4006d7f4781b00363b1ad1986f0dde11e Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 21 Jun 2021 10:23:53 +1000 Subject: [PATCH] Adds invoke task for deleting all database records --- tasks.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tasks.py b/tasks.py index 4522629e25..6ff998f586 100644 --- a/tasks.py +++ b/tasks.py @@ -365,6 +365,21 @@ def import_records(c, filename='data.json'): print("Data import completed") + +@task +def delete_data(c, force=False): + """ + Delete all database records! + + Warning: This will REALLY delete all records in the database!! + """ + + if force: + manage(c, 'flush', '--noinput') + else: + manage(c, 'flush') + + @task(post=[rebuild]) def import_fixtures(c): """