Deliverables database table - Create
From TaskDepender
(→Description) |
|||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
− | The two constraints for the table can be implemented by by [http://www.sqlite.org/foreignkeys.html#fk_actions | + | The two constraints for the table can be implemented by by referencing<ref name="referencing>[http://www.sqlite.org/foreignkeys.html#fk_actions Foreign keys - SQLite definition]</ref> these columns to the appropriate columns.This is done as follows: |
− | * Delete contained deliverable when container is deleted: reference the <tt>ContainerId</tt> column to the <tt>Id</tt> of the [[Tasks database table|tasks table]]. | + | * Delete contained deliverable when container is deleted: reference the <tt>ContainerId</tt> column to the <tt>Id</tt> of the [[Tasks database table|tasks table]]. |
− | * Delete cloned deliverable when parent deliverable is deleted: self-reference the <tt>ContainerId</tt> column to the <tt>Id</tt> column | + | * Delete cloned deliverable when parent deliverable is deleted: self-reference the <tt>ContainerId</tt> column to the <tt>Id</tt> column. |
− | + | ||
The last two constraints are implemented via [[Creating a cross reference|cross-referencing]] with the [[Connections database table|<tt>Connections</tt> table]]. Consequently, the <tt>ConnectionId</tt> field is added when this table is created. | The last two constraints are implemented via [[Creating a cross reference|cross-referencing]] with the [[Connections database table|<tt>Connections</tt> table]]. Consequently, the <tt>ConnectionId</tt> field is added when this table is created. | ||
Line 20: | Line 19: | ||
Name TEXT, | Name TEXT, | ||
Description TEXT, | Description TEXT, | ||
− | |||
X INTEGER, | X INTEGER, | ||
Y INTEGER, | Y INTEGER, | ||
Line 27: | Line 25: | ||
ContainerId INTEGER REFERENCES Tasks(Id) ON DELETE CASCADE, | ContainerId INTEGER REFERENCES Tasks(Id) ON DELETE CASCADE, | ||
Link TEXT, | Link TEXT, | ||
− | Available INTEGER | + | Available INTEGER |
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | == References == | ||
+ | <references/> | ||
---- | ---- | ||
* [[Deliverables database table]] | * [[Deliverables database table]] | ||
* [[Database]] | * [[Database]] |