• Status Unconfirmed
  • Percent Complete
  • Task Type Information
  • Category Database Queries
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 1.0 devel (github master)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Flyspray
Opened by nikos - 08.05.2017
Last edited by peterdd - 10.05.2017

FS#2432 - Delete tasks from all projects (like factory reset)

Is there any “ready” SQL query file to delete all tasks and start again ? (without deleting projects, project settings, categories, task types, tags, task statuses etc...)

nikos commented on 08.05.2017 16:38

Better title: Delete tasks from all projects (like factory reset)

Project Manager

I don't know about. What is the reason for doing that?

Flyspray tables are not connected by referential key constraints. ( ON DELETE CASCADE ).

Looking at the database diagram I did for Flyspray 1.0, most depending tables that 'references' the task_id can be emptied.

There are a few tables like flyspray_history that may contain rows that are not related to tasks.

Pseudo example (when the dbtable prefix is flyspray_ ) and MySQL is used:

TRUNCATE flyspray_dependencies;
TRUNCATE flyspray_task_tag;
TRUNCATE flyspray_related;
TRUNCATE flyspray_notifications;
TRUNCATE flyspray_assigned;

Some tables may contain not task related data like user registration, so keep that rows:

DELETE FROM flyspray_history WHERE task_id >=1;

If using databased task/comment caching, maybe table flyspray_cache needs to be cleared too.

And when deleting flyspray attachments, the folder attachments should be cleared too ..


TRUNCATE flyspray_tasks;

Deleting with TRUNCATE should also reset the autoincrement back to 1, so the next new task gets again id 1.


Available keyboard shortcuts


Task Details

Task Editing