I am in the process of setting up a block that I am converting from 1.9 to moodle 2.x. In the past i created foreign keys using the upgrade scripts. I am now trying to meet the Moodle standards as described by the XMLDB editor api docs (http://docs.moodle.org/dev/XMLDB_editor) and specifically where it says:
"About FOREIGN KEYS
- Under the tables of every XMLDB file, you must define the existing Foreign Keys (FK) properly. This will allow everybody to know a bit better the structure, allow to evolve to a better constrained system in the future and will provide the underlying code with the needed info to create the proper indexes.
- Note that, if you define any field combination as FK you won't have to create any index on that fields, the code will do it automatically!
- This convention is only applicable for relations INSIDE one file. Don't generate FK constraints against other files (courseid, userid), use indexes there."
I have 90 tables in my block and they reference each other like crazy. I have used the xmldb editor to set up the columns, indexes and foreign keys. After an install (Moodle 2.4.1) the tables are created, the columns are created and the indexes are created.
However no Foriegn Keys are created.
Does this mean I have to go in and manually create the forign keys?