Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

XMLDB Modifying the installation/upgrade process: Difference between revisions

From MoodleDocs
(Initial post)
 
Line 10: Line 10:
Starting with Moodle 1.7, all those *.sql files '''become completely replaced''' for one new file, '''"install.xml"''' which contains the necessary info to create all the DB structures for any DB supported by Moodle 1.7 (MySQL, PostgrSQL, SQL*Server and Oracle).  
Starting with Moodle 1.7, all those *.sql files '''become completely replaced''' for one new file, '''"install.xml"''' which contains the necessary info to create all the DB structures for any DB supported by Moodle 1.7 (MySQL, PostgrSQL, SQL*Server and Oracle).  


Following the next links, you can find more info about such [[[XMLDB defining an XML structure|XML structure]] and how to [[XMLDB creating new DDL functions|handle it]].
Following the next links, you can find more info about such [[XMLDB defining an XML structure|XML structure]] and how to [[XMLDB creating new DDL functions|handle it]].


These new, abstract and common '''install.xml''' files '''completely replace''' the old '''"*.sql'''" so they don't need to be maintained anymore (they'll be out from Moodle core code soon). Also, all the 3rd part contributions using db structures should migrate to the new '''"install.xml"''' files asap (it should be pretty easy to do so using the integrated '''XMLDEditor'''.
These new, abstract and common '''install.xml''' files '''completely replace''' the old '''"*.sql'''" so they don't need to be maintained anymore (they'll be out from Moodle core code soon). Also, all the 3rd part contributions using db structures should migrate to the new '''"install.xml"''' files asap (it should be pretty easy to do so using the integrated '''XMLDEditor'''.

Revision as of 17:17, 7 October 2006

XML database schema > Roadmap > XMLDB Creating new DDL functions


Once the XMLDB is ready, both the installation and the upgrade process will change notably and the schema used before Moodle 1.7 will be deprecated soon. Let's see some details about the changes.

Installation

Prior to Moodle 1.7, all the initial DB creation was performed reading and executing the information present in some "*.sql" files present under every "db" directory (lib/db, mod/xxx/db, block/xxx/db...). For each directory, at least two .sql files were present, "mysql.php" and "postgres7.php", each one ready to be used depending of the DB selected (MySQL or PostgreSQL).

Starting with Moodle 1.7, all those *.sql files become completely replaced for one new file, "install.xml" which contains the necessary info to create all the DB structures for any DB supported by Moodle 1.7 (MySQL, PostgrSQL, SQL*Server and Oracle).

Following the next links, you can find more info about such XML structure and how to handle it.

These new, abstract and common install.xml files completely replace the old "*.sql" so they don't need to be maintained anymore (they'll be out from Moodle core code soon). Also, all the 3rd part contributions using db structures should migrate to the new "install.xml" files asap (it should be pretty easy to do so using the integrated XMLDEditor.

Anyway, in order to maintain compatibility with all those 3rd part code contributions, the old .sql files for those modules, blocks... will continue being usable (only under MySQL and PostgreSQL!) until their new install.xml files will be created by developers.

Summarising: For each "db" dir inside Moodle. If the corresponding "install.xml" file is found, it's used to create all the DB structures, else the old ".sql" will be used.

Upgrade