delete all historical data django simple history

To delete all historical data in Django Simple History, you can follow these steps:

Step 1: Import the necessary modules

from simple_history.models import HistoricalRecords

Step 2: Retrieve the historical records for the model

historical_records = MyModel.history.all()

Step 3: Delete the historical records

historical_records.delete()

Step 4: Optional - Delete the instance from the model as well

my_model_instance.delete()