[redirect] nextagent column in chatthread

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@131 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2008-10-02 09:35:49 +00:00
parent 9ca2afb981
commit 9befc1c180
2 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,7 @@ $dbtables = array(
"ltoken" => "int NOT NULL",
"remote" => "varchar(255)",
"referer" => "text",
"nextagent" => "int NOT NULL DEFAULT 0",
"locale" => "varchar(8)",
"lastpinguser" => "datetime DEFAULT 0",
"lastpingagent" => "datetime DEFAULT 0",
@ -66,7 +67,7 @@ $dbtables = array(
$memtables = array();
$dbtables_can_update = array(
"chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount"),
"chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent"),
"chatmessage" => array("agentId"),
);

View File

@ -94,6 +94,10 @@ if ($act == "silentcreateall") {
runsql("ALTER TABLE chatmessage DROP INDEX idx_threadid_ikind", $link);
}
if( in_array("chatthread.nextagent", $absent) ) {
runsql("ALTER TABLE chatthread ADD nextagent int NOT NULL DEFAULT 0", $link);
}
$res = runsql("select null from information_schema.statistics where table_name = 'chatmessage' and index_name = 'idx_agentid'", $link);
if(mysql_num_rows($res) == 0) {
runsql("ALTER TABLE chatmessage ADD INDEX idx_agentid (agentid)", $link);