Deliverables database table - Create

From TaskDepender
Jump to: navigation, search
(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 referencing] these columns to the appropriate columns. This is done as follows:
+
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.
* Set <tt>RecourceId</tt> to <tt>NULL</tt> when recource deleted: reference <tt>RecourceId</tt> to the <tt>Id</tt> in the [[Resources database table|resources table]].
+
  
 
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,
  Resource 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]]

Latest revision as of 06:52, 30 November 2011

Personal tools