Difference between revisions of "Database Table: user"

From Dreamwidth Notes
Jump to: navigation, search
(Created page with 'This table stores most of the permanent, user-specific data determined during account setup. Note that the ''name'' field is the setting from the 'basic info' screen, not the nam...')
 
(Robot: Updating: Format)
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This table stores most of the permanent, user-specific data determined during account setup. Note that the ''name'' field is the setting from the 'basic info' screen, not the name of the account.
+
{{Database Table|name=user|table type=global|repo=dw-free}}
 +
[[description::This table stores some of the permanent, account-specific data for personal accounts, communities and feeds.]]
  
=Definition=
+
See [[Journal types]] for possible values of journaltype.
 +
= Definition =
 
<source lang="sql">
 
<source lang="sql">
 
CREATE TABLE user (
 
CREATE TABLE user (
:userid int(10) unsigned NOT NULL auto_increment,
+
    userid int(10) unsigned NOT NULL auto_increment,
:user char(15) default NULL,
+
    user char(25) default NULL,
:caps SMALLINT UNSIGNED NOT NULL DEFAULT 0,
+
    caps SMALLINT UNSIGNED NOT NULL DEFAULT 0,
:email char(50) default NULL,
+
    email char(50) default NULL,
:password char(30) default NULL,
+
    password char(30) default NULL,
:status char(1) NOT NULL default 'N',
+
    status char(1) NOT NULL default 'N',
:statusvis char(1) NOT NULL default 'V',
+
    statusvis char(1) NOT NULL default 'V',
:statusvisdate datetime default NULL,
+
    statusvisdate datetime default NULL,
:name char(50) default NULL,
+
    name char(50) default NULL,
:bdate date default NULL,
+
    bdate date default NULL,
:themeid int(11) NOT NULL default '1',
+
    themeid int(11) NOT NULL default '1',
:moodthemeid int(10) unsigned NOT NULL default '1',
+
    moodthemeid int(10) unsigned NOT NULL default '1',
:opt_forcemoodtheme enum('Y','N') NOT NULL default 'N',
+
    opt_forcemoodtheme enum('Y','N') NOT NULL default 'N',
:allow_infoshow char(1) NOT NULL default 'Y',
+
    allow_infoshow char(1) NOT NULL default 'Y',
:allow_contactshow char(1) NOT NULL default 'Y',
+
    allow_contactshow char(1) NOT NULL default 'Y',
:allow_getljnews char(1) NOT NULL default 'N',
+
    allow_getljnews char(1) NOT NULL default 'N',
:opt_showtalklinks char(1) NOT NULL default 'Y',
+
    opt_showtalklinks char(1) NOT NULL default 'Y',
:opt_whocanreply enum('all','reg','friends') NOT NULL default 'all',
+
    opt_whocanreply enum('all','reg','friends') NOT NULL default 'all',
:opt_gettalkemail char(1) NOT NULL default 'Y',
+
    opt_gettalkemail char(1) NOT NULL default 'Y',
:opt_htmlemail enum('Y','N') NOT NULL default 'Y',
+
    opt_htmlemail enum('Y','N') NOT NULL default 'Y',
:opt_mangleemail char(1) NOT NULL default 'N',
+
    opt_mangleemail char(1) NOT NULL default 'N',
:useoverrides char(1) NOT NULL default 'N',
+
    useoverrides char(1) NOT NULL default 'N',
:defaultpicid int(10) unsigned default NULL,
+
    defaultpicid int(10) unsigned default NULL,
:has_bio enum('Y','N') NOT NULL default 'N',
+
    has_bio enum('Y','N') NOT NULL default 'N',
:txtmsg_status enum('none','on','off') NOT NULL default 'none',
+
    txtmsg_status enum('none','on','off') NOT NULL default 'none',
:is_system enum('Y','N') NOT NULL default 'N',
+
    is_system enum('Y','N') NOT NULL default 'N',
:journaltype char(1) NOT NULL default 'P',
+
    journaltype char(1) NOT NULL default 'P',
:lang char(2) NOT NULL default 'EN',
+
    lang char(2) NOT NULL default 'EN',
:PRIMARY KEY:(userid),
+
 
:UNIQUE KEY user (user),
+
    PRIMARY KEY (userid),
:KEY (email),
+
    UNIQUE KEY user (user),
:KEY (status),
+
    KEY (email),
:KEY (statusvis)
+
    KEY (status),
 +
    KEY (statusvis)
 
)  PACK_KEYS=1
 
)  PACK_KEYS=1
 
</source>
 
</source>
 
+
{{Database Table Footer}}
 
+
=Relationships=
+
*Foreign key  themeid to [[themelist]].themeid
+
*Foreign key moodthemeid to [[moodthemes]].moodthemeid
+
 
+
=Location=
+
Clustered db(?)
+

Latest revision as of 16:01, 22 July 2010

This is a global table. This table stores some of the permanent, account-specific data for personal accounts, communities and feeds.

See Journal types for possible values of journaltype.

Definition

CREATE TABLE USER (
    userid INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    USER CHAR(25) DEFAULT NULL,
    caps SMALLINT UNSIGNED NOT NULL DEFAULT 0,
    email CHAR(50) DEFAULT NULL,
    password CHAR(30) DEFAULT NULL,
    STATUS CHAR(1) NOT NULL DEFAULT 'N',
    statusvis CHAR(1) NOT NULL DEFAULT 'V',
    statusvisdate datetime DEFAULT NULL,
    name CHAR(50) DEFAULT NULL,
    bdate DATE DEFAULT NULL,
    themeid INT(11) NOT NULL DEFAULT '1',
    moodthemeid INT(10) UNSIGNED NOT NULL DEFAULT '1',
    opt_forcemoodtheme enum('Y','N') NOT NULL DEFAULT 'N',
    allow_infoshow CHAR(1) NOT NULL DEFAULT 'Y',
    allow_contactshow CHAR(1) NOT NULL DEFAULT 'Y',
    allow_getljnews CHAR(1) NOT NULL DEFAULT 'N',
    opt_showtalklinks CHAR(1) NOT NULL DEFAULT 'Y',
    opt_whocanreply enum('all','reg','friends') NOT NULL DEFAULT 'all',
    opt_gettalkemail CHAR(1) NOT NULL DEFAULT 'Y',
    opt_htmlemail enum('Y','N') NOT NULL DEFAULT 'Y',
    opt_mangleemail CHAR(1) NOT NULL DEFAULT 'N',
    useoverrides CHAR(1) NOT NULL DEFAULT 'N',
    defaultpicid INT(10) UNSIGNED DEFAULT NULL,
    has_bio enum('Y','N') NOT NULL DEFAULT 'N',
    txtmsg_status enum('none','on','off') NOT NULL DEFAULT 'none',
    is_system enum('Y','N') NOT NULL DEFAULT 'N',
    journaltype CHAR(1) NOT NULL DEFAULT 'P',
    lang CHAR(2) NOT NULL DEFAULT 'EN',
 
    PRIMARY KEY  (userid),
    UNIQUE KEY USER (USER),
    KEY (email),
    KEY (STATUS),
    KEY (statusvis)
)  PACK_KEYS=1

Relationships

Outgoing

Incoming