Add some comments to database structure

This commit is contained in:
Dmitriy Simushev 2013-06-19 09:52:48 +00:00
parent 248847436b
commit aa38622b8d

View File

@ -31,30 +31,57 @@ $dbtables = array(
"vchosturl" => "varchar(255) DEFAULT ''", "vchosturl" => "varchar(255) DEFAULT ''",
), ),
// Chat threads
"${mysqlprefix}chatthread" => array( "${mysqlprefix}chatthread" => array(
// ID of the thread.
"threadid" => "int NOT NULL auto_increment PRIMARY KEY", "threadid" => "int NOT NULL auto_increment PRIMARY KEY",
// Name of the user in chat.
"userName" => "varchar(64) NOT NULL", "userName" => "varchar(64) NOT NULL",
// ID of the user. This field is foreign key for
// {chatsitevisitor}.userid
"userid" => "varchar(255)", "userid" => "varchar(255)",
// Name of the operator who took place in the chat.
"agentName" => "varchar(64)", "agentName" => "varchar(64)",
// ID of the operator who took place in the chat.
"agentId" => "int NOT NULL DEFAULT 0", "agentId" => "int NOT NULL DEFAULT 0",
// Unix timestamp of the moment when the thread was created.
"dtmcreated" => "int NOT NULL DEFAULT 0", "dtmcreated" => "int NOT NULL DEFAULT 0",
// Unix timestamp of the moment when chat actually started.
"dtmchatstarted" => "int NOT NULL DEFAULT 0", "dtmchatstarted" => "int NOT NULL DEFAULT 0",
// Unix timestamp of the last thread modification.
"dtmmodified" => "int NOT NULL DEFAULT 0", "dtmmodified" => "int NOT NULL DEFAULT 0",
// ID of the last thread revision.
"lrevision" => "int NOT NULL DEFAULT 0", "lrevision" => "int NOT NULL DEFAULT 0",
// State of the thread. It is one of Thread::STATE_* constants.
"istate" => "int NOT NULL DEFAULT 0", "istate" => "int NOT NULL DEFAULT 0",
// State of invitation related with the thread. It is one of
// Thread::INVITATION_* constants.
"invitationstate" => "int NOT NULL DEFAULT 0", "invitationstate" => "int NOT NULL DEFAULT 0",
// Last token of the thread.
"ltoken" => "int NOT NULL", "ltoken" => "int NOT NULL",
// IP address of the user.
"remote" => "varchar(255)", "remote" => "varchar(255)",
// Page from which chat thread was started.
"referer" => "text", "referer" => "text",
// ID of the operator who will next in the chat.
"nextagent" => "int NOT NULL DEFAULT 0", "nextagent" => "int NOT NULL DEFAULT 0",
// Code of chat locale.
"locale" => "varchar(8)", "locale" => "varchar(8)",
// Unix timestamp of the last request from user's window to server.
"lastpinguser" => "int NOT NULL DEFAULT 0", "lastpinguser" => "int NOT NULL DEFAULT 0",
// Unix timestamp of the last request from operator's window to server.
"lastpingagent" => "int NOT NULL DEFAULT 0", "lastpingagent" => "int NOT NULL DEFAULT 0",
// Indicates if user typing or not. It can take two values 0 and 1.
"userTyping" => "int DEFAULT 0", "userTyping" => "int DEFAULT 0",
// Indicates if operator typing or not. It can take two values 0 and 1.
"agentTyping" => "int DEFAULT 0", "agentTyping" => "int DEFAULT 0",
// ID of shown message in the chat.
"shownmessageid" => "int NOT NULL DEFAULT 0", "shownmessageid" => "int NOT NULL DEFAULT 0",
// User agent description that took from 'User-Agent' HTTP header.
"userAgent" => "varchar(255)", "userAgent" => "varchar(255)",
// Total count of messages related with the thread.
"messageCount" => "varchar(16)", "messageCount" => "varchar(16)",
// ID of the group at Mibew side related with the thread.
"groupid" => "int references ${mysqlprefix}chatgroup(groupid)", "groupid" => "int references ${mysqlprefix}chatgroup(groupid)",
), ),
@ -89,12 +116,20 @@ $dbtables = array(
// Store chat thread messages // Store chat thread messages
"${mysqlprefix}chatmessage" => array( "${mysqlprefix}chatmessage" => array(
// Message ID.
"messageid" => "int NOT NULL auto_increment PRIMARY KEY", "messageid" => "int NOT NULL auto_increment PRIMARY KEY",
// ID of the thread related with the message.
"threadid" => "int NOT NULL references ${mysqlprefix}chatthread(threadid)", "threadid" => "int NOT NULL references ${mysqlprefix}chatthread(threadid)",
// Message kind. It is one of Thread::KIND_* constants.
"ikind" => "int NOT NULL", "ikind" => "int NOT NULL",
// ID of operator who sent the message. This value will be ignored for
// system messages and messages which sent by users.
"agentId" => "int NOT NULL DEFAULT 0", "agentId" => "int NOT NULL DEFAULT 0",
// Message text body.
"tmessage" => "text NOT NULL", "tmessage" => "text NOT NULL",
// Unix timestamp when message was created.
"dtmcreated" => "int NOT NULL DEFAULT 0", "dtmcreated" => "int NOT NULL DEFAULT 0",
// Name of the message sender.
"tname" => "varchar(64)" "tname" => "varchar(64)"
), ),