Commit a3cafb31 authored by Francois Gannaz's avatar Francois Gannaz
Browse files

fix the DB structure

parent 4d9c4072
......@@ -4,7 +4,7 @@
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="labnbook_user" COMMENT="matching users bewteen Moodle and LabNbook">
<TABLE NAME="mod_labnbook_user" COMMENT="matching users bewteen Moodle and LabNbook">
<FIELDS>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="labnbook_userid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
......@@ -15,7 +15,19 @@
<KEY NAME="userid" TYPE="foreign-unique" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="labnbook_teamconfig" COMMENT="configuration for teams in an activity">
<TABLE NAME="mod_labnbook" COMMENT="Activity instance">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="labnbook_missionid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="mod_labnbook_teamconfig" COMMENT="configuration for teams in an activity">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
......@@ -39,10 +51,11 @@
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="instanceid" TYPE="foreign" FIELDS="instanceid" REFTABLE="mod_labnbook" REFFIELDS="id"/>
<KEY NAME="groupid" TYPE="foreign" FIELDS="groupid" REFTABLE="group" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="labnbook_team" COMMENT="team of users">
<TABLE NAME="mod_labnbook_team" COMMENT="team of users">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="teamconfigid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
......@@ -51,10 +64,10 @@
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="teamconfigid" TYPE="foreign" FIELDS="teamconfigid" REFTABLE="teamconfig" REFFIELDS="id"/>
<KEY NAME="teamconfigid" TYPE="foreign" FIELDS="teamconfigid" REFTABLE="mod_labnbook_teamconfig" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="labnbook_teammember" COMMENT="team of users">
<TABLE NAME="mod_labnbook_teammember" COMMENT="team of users">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="teamid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
......@@ -63,7 +76,7 @@
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="teamid" TYPE="foreign" FIELDS="teamid" REFTABLE="team" REFFIELDS="id"/>
<KEY NAME="teamid" TYPE="foreign" FIELDS="teamid" REFTABLE="mod_labnbook_team" REFFIELDS="id"/>
<KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id"/>
</KEYS>
</TABLE>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment