From d43655c96286c92a74fc69461ecbe8e0796d332f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 18 Sep 2005 17:09:56 +0000 Subject: - Patch #31449 by chx: store session IDs in the accesslog table. --- database/updates.inc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'database/updates.inc') diff --git a/database/updates.inc b/database/updates.inc index 96d8da6fc..f3938a45f 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -66,7 +66,8 @@ $sql_updates = array( "2005-08-08" => "update_144", "2005-08-15" => "update_145", "2005-08-25" => "update_146", - "2005-09-07" => "update_147" + "2005-09-07" => "update_147", + "2005-09-18" => "update_148" ); function update_110() { @@ -811,6 +812,26 @@ function update_147() { return $ret; } +function update_148() { + $ret = array(); + + // Add support for tracking users' session ids (useful for tracking anon users) + switch ($GLOBALS['db_type']) { + case 'pgsql': + $ret[] = update_sql("ALTER TABLE {accesslog} ADD sid varchar(32)"); + $ret[] = update_sql("ALTER TABLE {accesslog} ALTER sid SET NOT NULL"); + $ret[] = update_sql("ALTER TABLE {accesslog} ALTER sid SET DEFAULT ''"); + break; + case 'mysql': + case 'mysqli': + $ret[] = update_sql("ALTER TABLE {accesslog} ADD sid varchar(32) NOT NULL default ''"); + break; + default: + break; + } + + return $ret; +} function update_sql($sql) { $edit = $_POST["edit"]; -- cgit v1.2.3