mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 10:05:39 +00:00
Adds invoke task for deleting all database records
This commit is contained in:
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):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user