1 <?xml version="1.0" encoding="UTF-8" ?>
2 <XMLDB PATH="mod/chat/db" VERSION="20070122" COMMENT="XMLDB file for Moodle mod/chat"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
7 <TABLE NAME="chat" COMMENT="Each of these is a chat room" NEXT="chat_messages">
9 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
10 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
11 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
12 <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="keepdays"/>
13 <FIELD NAME="keepdays" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="studentlogs"/>
14 <FIELD NAME="studentlogs" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="keepdays" NEXT="chattime"/>
15 <FIELD NAME="chattime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentlogs" NEXT="schedule"/>
16 <FIELD NAME="schedule" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="chattime" NEXT="timemodified"/>
17 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="schedule"/>
20 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for chat"/>
23 <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
26 <TABLE NAME="chat_messages" COMMENT="Stores all the actual chat messages" PREVIOUS="chat" NEXT="chat_users">
28 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="chatid"/>
29 <FIELD NAME="chatid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
30 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="chatid" NEXT="groupid"/>
31 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="system"/>
32 <FIELD NAME="system" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="message"/>
33 <FIELD NAME="message" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="system" NEXT="timestamp"/>
34 <FIELD NAME="timestamp" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="message"/>
37 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for chat_messages" NEXT="chatid"/>
38 <KEY NAME="chatid" TYPE="foreign" FIELDS="chatid" REFTABLE="chat" REFFIELDS="id" PREVIOUS="primary"/>
41 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" NEXT="groupid"/>
42 <INDEX NAME="groupid" UNIQUE="false" FIELDS="groupid" PREVIOUS="userid" NEXT="timestamp-chatid"/>
43 <INDEX NAME="timestamp-chatid" UNIQUE="false" FIELDS="timestamp, chatid" PREVIOUS="groupid"/>
46 <TABLE NAME="chat_users" COMMENT="Keeps track of which users are in which chat rooms" PREVIOUS="chat_messages">
48 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="chatid"/>
49 <FIELD NAME="chatid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
50 <FIELD NAME="userid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="chatid" NEXT="groupid"/>
51 <FIELD NAME="groupid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="version"/>
52 <FIELD NAME="version" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="ip"/>
53 <FIELD NAME="ip" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="firstping"/>
54 <FIELD NAME="firstping" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ip" NEXT="lastping"/>
55 <FIELD NAME="lastping" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="firstping" NEXT="lastmessageping"/>
56 <FIELD NAME="lastmessageping" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastping" NEXT="sid"/>
57 <FIELD NAME="sid" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastmessageping" NEXT="course"/>
58 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sid" NEXT="lang"/>
59 <FIELD NAME="lang" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course"/>
62 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for chat_users" NEXT="chatid"/>
63 <KEY NAME="chatid" TYPE="foreign" FIELDS="chatid" REFTABLE="chat" REFFIELDS="id" PREVIOUS="primary"/>
66 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" NEXT="lastping"/>
67 <INDEX NAME="lastping" UNIQUE="false" FIELDS="lastping" PREVIOUS="userid" NEXT="groupid"/>
68 <INDEX NAME="groupid" UNIQUE="false" FIELDS="groupid" PREVIOUS="lastping"/>
73 <STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
75 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'view', 'chat', 'name')" />
76 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'add', 'chat', 'name')" />
77 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'update', 'chat', 'name')" />
78 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'report', 'chat', 'name')" />
79 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('chat', 'talk', 'chat', 'name')" />