Difference between revisions of "Relation Table"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This table stores the relationships between things in Truxton. <syntaxhighlight lang="SQL"> CREATE TABLE "Relation" ( "A_ID" uuid NOT NULL, "B_ID" uuid NOT NULL,...")
 
Line 1: Line 1:
 
This table stores the relationships between things in Truxton.
 
This table stores the relationships between things in Truxton.
 +
This is how the [https://en.wikipedia.org/wiki/Graph_(discrete_mathematics) graph] of Truxton objects is stored.
  
<syntaxhighlight lang="SQL">
+
<source lang="SQL">
 
CREATE TABLE "Relation" (
 
CREATE TABLE "Relation" (
 
     "A_ID" uuid NOT NULL,
 
     "A_ID" uuid NOT NULL,
Line 11: Line 12:
 
     "SourceObjectTypeID" smallint NOT NULL
 
     "SourceObjectTypeID" smallint NOT NULL
 
);
 
);
</syntaxhighlight>
+
</source>

Revision as of 08:49, 8 December 2020

This table stores the relationships between things in Truxton. This is how the graph of Truxton objects is stored.

CREATE TABLE "Relation" (
    "A_ID" uuid NOT NULL,
    "B_ID" uuid NOT NULL,
    "A_ObjectTypeID" smallint NOT NULL,
    "B_ObjectTypeID" smallint NOT NULL,
    "RelationTypeID" integer NOT NULL,
    "SourceID" uuid NOT NULL,
    "SourceObjectTypeID" smallint NOT NULL
);