Task list database table - TaskDepender

Task list database table

From TaskDepender
Jump to: navigation, search
(Undo revision 636 by Fred (talk))
(Design)
Line 15: Line 15:
 
[[Image:Create_as.png]]
 
[[Image:Create_as.png]]
  
Additionally, also a <tt>IsContainer</tt> column needs to be specified which indicates whether the task is container. This can be done by going through the [[Tasks database table|tasks table]] and the [[Deliverables database table|deliverables table]] and counting the elements that have the <tt>ContainerId</tt> equal to the id of the task that is being added to the table. If this is greater than 0 then the task is a container. The query statement must take [[Clone|clones]] into account; those are contained in a task but are not to be counted as being a contained element.
+
Additionally, also a <tt>IsContainer</tt> column needs to be specified which indicates whether the task is container. This can be done by going through the [[Tasks database table|tasks table]] and the [[Deliverables database table|deliverables table]] and counting the elements that have the <tt>ContainerId</tt> equal to the id of the task that is being added to the table. If this is greater than 0 then the task is a container. The query statement must take [[Clone|clones]] into account; those are contained in a task but are not to be counted as being a contained element. The id of the current container can be retrieved by using the [[State variables database table]].
  
Furthermore, to automatically maintain consistency, a constraint must be added to the table as well so that when the original task is deleted, the corresponding task in this table is deleted as well. However, when the table is created using the AS-SELECT statement, the constraint is not implemented yet. Therefore, after the table is created, the table must be [http://www.sqlite.org/lang_altertable.html altered] to create a reference to the original task in the [[Tasks database table|tasks table]]. The [www.sqlite.org SQLite] only supports a limited subset of [http://www.sqlite.org/lang_altertable.html ALTER TABLE] and it does not allow renaming or removing a column, or add or remove constraints from a table. Therefore, to implement the constraint, an additional column <tt>Parent</tt> is added that is referenced to the <tt>Id</tt> of the [[Tasks_database_table|tasks table]]. After creating this column, it must still be filled with the same value as the <tt>Id</tt>.
+
Furthermore, to automatically maintain consistency, a constraint must be added to the table as well so that when the original task is deleted, the corresponding task in this table is deleted as well. However, when the table is created using the AS-SELECT statement, the constraint cannot implemented yet as it cannot be part of the statement as can be seen from the syntax diagram above. Therefore, after the table is created, the table must be [http://www.sqlite.org/lang_altertable.html altered] to create a reference to the original task in the [[Tasks database table|tasks table]]. However, the [www.sqlite.org SQLite] only supports a limited subset of [http://www.sqlite.org/lang_altertable.html ALTER TABLE] and (amongst other) does not allow adding constraints to a table. Therefore, to implement the constraint, an additional column <tt>Parent</tt> is added that is referenced to the <tt>Id</tt> of the [[Tasks_database_table|tasks table]]. After creating this column, it must still be filled with the same value as the <tt>Id</tt>.
 
+
The id of the current container can be retrieved by using the [[State variables database table]].
+
  
 
== Implementation ==
 
== Implementation ==

Revision as of 17:50, 16 October 2011

Personal tools