-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update xmldb.md #710
Update xmldb.md #710
Conversation
✅ Deploy Preview for moodledevdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Luca,
How about simply indenting them?
1. About names:
1. All lowercase names (tables, indexes, keys and fields).
1. Table names and field names must use only a-z, 0-9 and _ chars. Max 28 characters.
1. Key and index names under the XMLDB Files must be formed by concatenating the name of the fields present in the key/index with the '"-" (minus) character.
1. Primary key always must be named "primary" (this is one exception to the previous convention).
1. It's highly recommended to avoid [reserved words](https://docs.moodle.org/dev/XMLDB_reserved_words) completely. We know we have some of them now but they should be completely out for next releases.
1. About NULLS
1. Avoid to create all the fields as NOT NULL with the *silly* default value `*` (empty string). The underlying code used to create tables will handle it properly but the XMLDB structure must be REAL. Read more in the [Problems Page](https://docs.moodle.org/dev/XMLDB_Problems#NOT_NULL_fields_using_a_DEFAULT_*_clause).
1. About FOREIGN KEYS
1. 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.
1. 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!
1. Respect Convention 1.3
1. About UNIQUE KEYS
1. Declare any fields as UNIQUE KEY (UK) only if they are going to be used as target for one FK. Create unique indexes instead.
1. Respect Convention 1.3
No need for all of this HTML.
0ab7824
to
8317e9b
Compare
Okay fair enough @andrewnicols |
bc165b4
to
44c80b9
Compare
Ordering of the Conventions List as in https://docs.moodle.org/dev/XMLDB_defining_an_XML_structure. Note that the Github Markdown preview does not do accurately preview ordered lists second level numbers like they should appear see https://youtu.be/iBA-j6XaHNc?si=w1mE3--keCxcnxZR&t=333 I hope docusaurus then gets it right.
Head branch was pushed to by a user without write access
44c80b9
to
4933162
Compare
Ordering of the Conventions List as in https://docs.moodle.org/dev/XMLDB_defining_an_XML_structure. Note that the Github Markdown preview does not do accurately preview ordered lists second level numbers like they should appear see https://youtu.be/iBA-j6XaHNc?si=w1mE3--keCxcnxZR&t=333 I hope docusaurus then gets it right.