<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="local/kopere_dashboard/db" VERSION="20250228" COMMENT="XMLDB file for Moodle local/kopere_dashboard"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
    <TABLES>
        <TABLE NAME="local_kopere_dashboard_menu" COMMENT="Webpages Menus">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="menuid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="link" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="inheader" TYPE="int" LENGTH="1" NOTNULL="true" SEQUENCE="false"/>
                <FIELD NAME="icon" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
            </KEYS>
        </TABLE>
        <TABLE NAME="local_kopere_dashboard_pages" COMMENT="Webpages">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="menuid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="link" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="text" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="theme" TYPE="char" LENGTH="32" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="pageorder" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="config" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
            </KEYS>
        </TABLE>

        <TABLE NAME="local_kopere_dashboard_audit" COMMENT="Central audit log for Kopere Dashboard subplugins.">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
                <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false"/>
                <FIELD NAME="action" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false"/>
                <FIELD NAME="objecttable" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="objectid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="description" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="ip" TYPE="char" LENGTH="45" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="useragent" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
                <FIELD NAME="detailsjson" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
            </KEYS>
            <INDEXES>
                <INDEX NAME="idx_time" UNIQUE="false" FIELDS="timecreated"/>
                <INDEX NAME="idx_component" UNIQUE="false" FIELDS="component"/>
                <INDEX NAME="idx_user" UNIQUE="false" FIELDS="userid"/>
            </INDEXES>
        </TABLE>

    </TABLES>
</XMLDB>
