mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds invoke task for deleting all database records
This commit is contained in:
parent
213e4dccc5
commit
8e9e04b400
15
tasks.py
15
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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user