LMSouq
moodle-core Open

Create new table in moodle from plugin using install.xml file

TU
Tushar
1 month ago
3 views
Problem Description
I have created one plugin "tuition" and install that in moodle(2.5.2) from moodle/blocks directory. After that I have tried to create some table from new Plugin (tuition). I have created install.xml file in tuition/db/ directory and change the version in version.php file. when I update my tuition plugin, it shows that plugin is updated successfully but it doesn't create any table. I have attached my install.xml file here. please some one tell me where is the problem to update the plugin <?xml version="1.0" encoding="UTF-8" ?> <XMLDB PATH="mod/label/db" VERSION="20060905" COMMENT="XMLDB file for Moodle mod/label" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd" > <TABLES> <TABLE NAME="block_tuition_comments"> <FIELDS> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="instanceid"/> <FIELD NAME="instanceid" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="createdbyid"/> <FIELD NAME="createdbyid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="instanceid" NEXT="dt"/> <FIELD NAME="dt" TYPE="datetime" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="createdbyid" NEXT="message"/> <FIELD NAME="message" TYPE="char" LENGTH="300" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="dt"/> </FIELDS> <KEYS> <KEY NAME="primary" TYPE="primary" FIELDS="id"/> </KEYS> </TABLE> </TABLES> </XMLDB> part of install.xml file

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base