Difference between revisions of "Database Table: log2"

From Dreamwidth Notes
Jump to: navigation, search
m
Line 1: Line 1:
 
+
{{#set:name=log2|clustered=true}}
 
= Definition =
 
= Definition =
  
 
<source lang="sql">
 
<source lang="sql">
CREATE TABLE links (
+
CREATE TABLE log2 (
  journalid int(10) unsigned NOT NULL default '0',
+
    journalid INT UNSIGNED NOT NULL default '0',
  ordernum tinyint(4) unsigned NOT NULL default '0',
+
    jitemid MEDIUMINT UNSIGNED NOT NULL,
  parentnum tinyint(4) unsigned NOT NULL default '0',
+
    PRIMARY KEY  (journalid, jitemid),
  url varchar(255) default NULL,
+
    posterid int(10) unsigned NOT NULL default '0',
  title varchar(255) NOT NULL default '',
+
    eventtime datetime default NULL,
  KEY (journalid)
+
    logtime datetime default NULL,
 +
    compressed char(1) NOT NULL default 'N',
 +
    anum TINYINT UNSIGNED NOT NULL,
 +
    security enum('public','private','usemask') NOT NULL default 'public',
 +
    allowmask bigint(20) unsigned NOT NULL default '0',
 +
    replycount smallint(5) unsigned default NULL,
 +
    year smallint(6) NOT NULL default '0',
 +
    month tinyint(4) NOT NULL default '0',
 +
    day tinyint(4) NOT NULL default '0',
 +
    rlogtime int(10) unsigned NOT NULL default '0',
 +
    revttime int(10) unsigned NOT NULL default '0',
 +
 
 +
    KEY (journalid,year,month,day),
 +
    KEY `rlogtime` (`journalid`,`rlogtime`),
 +
    KEY `revttime` (`journalid`,`revttime`),
 +
    KEY `posterid` (`posterid`,`journalid`)
 
)
 
)
 
</source>
 
</source>
  
= Relationships =
+
{{Database Table Footer}}
 
+
= Location =
+
 
+
[[Clustered database]]
+
 
+
[[Category: Database Tables|log2]]
+

Revision as of 00:50, 2 October 2009

Definition

CREATE TABLE log2 (
    journalid INT UNSIGNED NOT NULL DEFAULT '0',
    jitemid MEDIUMINT UNSIGNED NOT NULL,
    PRIMARY KEY  (journalid, jitemid),
    posterid INT(10) UNSIGNED NOT NULL DEFAULT '0',
    eventtime datetime DEFAULT NULL,
    logtime datetime DEFAULT NULL,
    compressed CHAR(1) NOT NULL DEFAULT 'N',
    anum TINYINT UNSIGNED NOT NULL,
    security enum('public','private','usemask') NOT NULL DEFAULT 'public',
    allowmask BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
    replycount SMALLINT(5) UNSIGNED DEFAULT NULL,
    YEAR SMALLINT(6) NOT NULL DEFAULT '0',
    MONTH tinyint(4) NOT NULL DEFAULT '0',
    DAY tinyint(4) NOT NULL DEFAULT '0',
    rlogtime INT(10) UNSIGNED NOT NULL DEFAULT '0',
    revttime INT(10) UNSIGNED NOT NULL DEFAULT '0',
 
    KEY (journalid,YEAR,MONTH,DAY),
    KEY `rlogtime` (`journalid`,`rlogtime`),
    KEY `revttime` (`journalid`,`revttime`),
    KEY `posterid` (`posterid`,`journalid`)
)

Relationships

Outgoing

  • Foreign key: journalid to user.userid
  • Foreign key: posterid to user.userid

Incoming