MWX/SpamFerret/tables/sessions: Difference between revisions

From Woozle Writes Code
< MWX‎ | SpamFerret‎ | tables
Jump to navigation Jump to search
(Created page with '==SQL== <mysql>CREATE TABLE `sessions` ( `ID` INT NOT NULL AUTO_INCREMENT, `Address` varchar(15) COMMENT "IP address", `Username` varchar(255) COMME…')
 
m (Woozle moved page SpamFerret/tables/sessions to MWX/SpamFerret/tables/sessions without leaving a redirect: most mediawiki extensions belong under MWX now)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
==About==
* '''Status''': NOT NEEDED
===Notes===
I added the <u>sessions</u> table when I thought the MediaWiki software wasn't recording IP addresses anywhere, but then it turns out that the IP address and username is stored in recentchanges for each edit (user ID = rc_user, user name = rc_user_text, IP address = rc_ip). It may turn out to be easier to use <u>sessions</u> for reports and such (can you do a JOIN across databases?), but for now it isn't actually used.
If I ''were'' going to use it, I'd probably revise the other tables to point to it instead of recording user info locally.
==SQL==
==SQL==
<mysql>CREATE TABLE `sessions` (
<mysql>CREATE TABLE `sessions` (
Line 10: Line 16:
   `WhenFinish` DATETIME DEFAULT NULL COMMENT "when this session ended (logout, if any)",
   `WhenFinish` DATETIME DEFAULT NULL COMMENT "when this session ended (logout, if any)",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
)</mysql>
) ENGINE = MYISAM;</mysql>

Latest revision as of 20:14, 1 May 2022

About

  • Status: NOT NEEDED

Notes

I added the sessions table when I thought the MediaWiki software wasn't recording IP addresses anywhere, but then it turns out that the IP address and username is stored in recentchanges for each edit (user ID = rc_user, user name = rc_user_text, IP address = rc_ip). It may turn out to be easier to use sessions for reports and such (can you do a JOIN across databases?), but for now it isn't actually used.

If I were going to use it, I'd probably revise the other tables to point to it instead of recording user info locally.

SQL

<mysql>CREATE TABLE `sessions` (

 `ID` INT NOT NULL AUTO_INCREMENT,
 `Address`    varchar(15)           COMMENT "IP address",
 `Username`   varchar(255)          COMMENT "username",
 `Browser`    varchar(255) NOT NULL COMMENT "browser client string",
 `ID_User`    INT      DEFAULT NULL COMMENT "MediaWiki user.user_id",
 `PageServer` varchar(63)  NOT NULL COMMENT "identifier of site logged in to (usually domain)",
 `WhenStart`  DATETIME     NOT NULL COMMENT "when this session began (login)",
 `WhenFinish` DATETIME DEFAULT NULL COMMENT "when this session ended (logout, if any)",
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql>