Deliverables database table - TaskDepender

Deliverables database table

From TaskDepender
Jump to: navigation, search
(Constraints)
(Implementation)
Line 82: Line 82:
  
 
== Implementation ==
 
== Implementation ==
 +
 +
=== Interface structure ===
 +
 +
<syntaxhighlight lang="cpp">
 +
typedef struct
 +
{
 +
  uint32 id,
 +
  char*  name,
 +
  char*  description,
 +
  uint  resourceId,
 +
  uint  x,
 +
  uint  y,
 +
  uint  width,
 +
  uint  height,
 +
  uint32 container_id
 +
} tdd_deliverable;
 +
</syntaxhighlight>
 +
  
 
=== Create table ===
 
=== Create table ===
Line 94: Line 112:
 
   X INTEGER,
 
   X INTEGER,
 
   Y INTEGER,
 
   Y INTEGER,
 +
  Width INTEGER,
 +
  Height INTEGER,
 
   ContainerId INTEGER REFERENCES Tasks(Id) ON DELETE CASCADE,
 
   ContainerId INTEGER REFERENCES Tasks(Id) ON DELETE CASCADE,
 
   Link TEXT,
 
   Link TEXT,
Line 104: Line 124:
 
<syntaxhighlight lang="sql">
 
<syntaxhighlight lang="sql">
 
INSERT INTO Deliverables
 
INSERT INTO Deliverables
(Name,Description, Resource, X, Y, Link, Available, ConnectionId, ContainerId)
+
(Name,Description, Resource, X, Y,  Width, Height, Link, Available, ConnectionId, ContainerId)
VALUES (%s, %s, %s, %d, %d, %s, %d, 0, (SELECT Val FROM StateVariables WHERE Name='CurrentContainerId'))
+
VALUES (%s, %s, %s, %d, %d, %d, %d, %s, %d, 0, (SELECT Val FROM StateVariables WHERE Name='CurrentContainerId'))
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 118: Line 138:
 
   Y=%d,
 
   Y=%d,
 
   Link=%s,
 
   Link=%s,
 +
  Width=%d,
 +
  Height=%d
 
   Available=%d
 
   Available=%d
 
WHERE Id IN (SELECT Id FROM SelectedDeliverables LIMIT 1)
 
WHERE Id IN (SELECT Id FROM SelectedDeliverables LIMIT 1)

Revision as of 21:33, 17 November 2011