1

1

Sometimes, you need to clear out a swath of cases. For instance, if you're wanting to archive or share your database, but not all of it. Where do you clear out those cases?

flag

1 Answer

2

Back up your data!

Is your data backed up?

Find the project id (or other identifier) and run these delete statements.

DELETE FROM Attachment  
  WHERE ixBugEvent IN  
  (SELECT BugEvent.ixBugEvent FROM BugEvent  
    LEFT JOIN Bug USING ixBug  
    WHERE Bug.ixProject = 123);
DELETE FROM BugEvent  
  WHERE ixBug IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM BugView  
  WHERE ixBug IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM BugRelation  
  WHERE ixBugFrom IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM BugRelation  
  WHERE ixBugTo IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM Duplicates  
  WHERE ixBugDupe IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM Duplicates  
  WHERE ixBugDupeOf IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM Scout WHERE ixBug IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM TagAssociation 
  WHERE ixBug > 0 AND ixBug IN (SELECT ixBug FROM Bug WHERE ixProject=123);
DELETE FROM Bug WHERE ixProject = 123;
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.