Hi Mohammad,
There are a few ways to do it.
Through Mango:
There is a button, "Purge all events" in the "Purge Settings" section on the system settings page. If your events table is large, this could take a while.
Through the SQL console:
delete from userEvents;
delete from events;
And my suggestion would be to do it from the database shell, since this will be very very fast regardless of table size:
Navigate to /opt/mango/bin/
Edit
h2-web-console.sh to add the -webAllowOthers argument as instructed by the comment near the bottom, such that you can access it from your other computer.
sudo ./h2-web-console.sh
In your browser, navigate to the port defined in
h2-web-console.sh, probably <Mango IP>:8081
Log in, your connection string will be /opt/mango/databases/mah2 and the username and password are probably blank, but if not they will be explicit in the H2 section of your env.properties, at either Mango/overrides/properties/ or Mango/classes
Run the following command:
SET FOREIGN_KEY_CHECKS=0; CREATE TABLE eventsNewTable LIKE events; DROP TABLE events; RENAME TABLE eventsNewTable TO events; CREATE TABLE userEventsNewTable LIKE userEvents; DROP TABLE userEvents; RENAME TABLE userEventsNewTable TO userEvents; SET FOREIGN_KEY_CHECKS=1;
It's good to have Mango off while doing that, but not required as the operations are so fast (but some database errors will probably be thrown by Mango right when the command is run).
7. Ctrl + c the h2-web-console.sh
And you're done!