Task list database table - TaskDepender

Task list database table

From TaskDepender
Jump to: navigation, search
(Undo revision 637 by Fred (talk))
(Undo revision 636 by Fred (talk))
Line 32: Line 32:
 
   OR  
 
   OR  
 
   (SELECT COUNT(ContainerId) from Deliverables where Deliverables.ContainerId=t.Id AND Deliverable.CloneId=0)>0 IsContainer  
 
   (SELECT COUNT(ContainerId) from Deliverables where Deliverables.ContainerId=t.Id AND Deliverable.CloneId=0)>0 IsContainer  
  FROM Tasks t WHERE ContainerId=(SELECT Value FROM StateVariables WHERE Key='CurrentContainerId'),
+
FROM Tasks t WHERE ContainerId=(SELECT Value FROM StateVariables WHERE Key='CurrentContainerId')  
   FOREIGN KEY(Id) REFERENCES Tasks(Id) ON DELETE CASCADE
+
</syntaxhighlight>
 +
 
 +
=== Add reference to the original task ===
 +
 
 +
<syntaxhighlight lang="sql">
 +
ALTER TABLE TaskList ADD
 +
   Parent INTEGER REFERENCES Tasks(Id) ON DELETE CASCADE
 +
</syntaxhighlight>
 +
 
 +
=== Fill reference field ===
 +
 
 +
<syntaxhighlight lang="sql">
 +
UPDATE TasksList SET Parent=Id
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 17:42, 16 October 2011