Difference between revisions of "Database Table: reluser2"

From Dreamwidth Notes
Jump to: navigation, search
(Robot: Updating: Format)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Stores information about community memberships. This is in the clustered database; [[Database Tables: reluser|reluser]] stores related information in the global database.
+
{{Database Table|name=reluser2|table type=clustered|repo=dw-free}}
 +
[[Description::User-space (clustered) relationships table. Only used for 'hide this comm from my profile page'.]]
 +
This is in the clustered database; [[Database Table: reluser|reluser]] stores related information in the global database.
  
[[Category: Database Tables|reluser2]]
+
Possible values of ''type'' are defined in get_reluser_id, in [[ljrelation.pl]]. Note that this does not take the same values as the char(1) ''type'' field in [[Database Table: reluser|reluser]].
=Definition=
+
= Definition =
 
<source lang="sql">
 
<source lang="sql">
CREATE TABLE reluser (
+
CREATE TABLE reluser2 (
:userid     INT UNSIGNED NOT NULL,
+
     userid    INT UNSIGNED NOT NULL,
:targetid  INT UNSIGNED NOT NULL,
+
    type      SMALLINT UNSIGNED NOT NULL,
:type      char(1) NOT NULL,
+
    targetid  INT UNSIGNED NOT NULL,
:PRIMARY KEY (userid,type,targetid),
+
 
:KEY (targetid,type)
+
    PRIMARY KEY (userid,type,targetid),
 +
    INDEX (userid,targetid)
 
)
 
)
 
</source>
 
</source>
 
+
{{Database Table Footer}}
=Relationships=
+
*Foreign key  userid to [[user]].userid
+
*Foreign key targetid to [[user]].userid
+
 
+
Possible values of ''type'' are defined in get_reluser_id, in [[ljrelation.pl]]. Note that this does not take the same values as the char(1) ''type'' field in [[reluser]].
+
 
+
=Location=
+
Clustered db
+

Latest revision as of 15:56, 22 July 2010

This is a clustered table. User-space (clustered) relationships table. Only used for 'hide this comm from my profile page'. This is in the clustered database; reluser stores related information in the global database.

Possible values of type are defined in get_reluser_id, in ljrelation.pl. Note that this does not take the same values as the char(1) type field in reluser.

Definition

CREATE TABLE reluser2 (
    userid    INT UNSIGNED NOT NULL,
    TYPE      SMALLINT UNSIGNED NOT NULL,
    targetid  INT UNSIGNED NOT NULL,
 
    PRIMARY KEY (userid,TYPE,targetid),
    INDEX (userid,targetid)
)

Relationships

Outgoing

  • Foreign key: targetid to user.userid
  • Foreign key: userid to user.userid