Installation of foreign keys

Installation of foreign keys

Eric Richer發表於
Number of replies: 2

Good day folks, 

maybe I am missing something here but do foreign keys really not get installed in the database when Moodle is installed?

I see some keys defined in the install.xml files but they aren't present in the DB.  Maybe this is just an installation thing and a script needs to be run afterwards?

Cheers

評比平均分數: -
In reply to Eric Richer

Re: Installation of foreign keys

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Historically, Moodle was developed with versions of MySQL that did not support foreign keys. I'm not completely sure what the status is now... I suspect very patchy.
In reply to Eric Richer

Re: Installation of foreign keys

Marcus Green發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

You are not missing anything.  The Foreign Key information in the xml is discarded during installation along with field level comments. 

You can read more about it here

https://github.com/marcusgreen/moodle_local-sqlgenerator/wiki

And the results of my work on table relationships can be seen in this set of er diagrams 

https://www.examulator.com/er/output/relationships.html

and table descriptions.

https://www.examulator.com/er/output/index.html

The introduction page.

http://www.examulator.com/er

評比平均分數:Useful (2)