Development:Database schema introduction: Difference between revisions
No edit summary |
Román Huerta (talk | contribs) |
||
Line 7: | Line 7: | ||
==Configuration== | ==Configuration== | ||
===config=== | |||
On this table there is stored data about the main configuration of the moodle installation, their fields are: | |||
- id | |||
- name | |||
- value | |||
===config_plugins=== | |||
On this table there is stored data about the plugins that have been installed on our moodle installation, their fields are: | |||
- id | |||
- plugin | |||
- name | |||
- value | |||
==Users and their profiles== | ==Users and their profiles== |
Revision as of 14:38, 21 July 2008
The Moodle database has around 200 tables, and can be quite daunting at first sight. The good news is that you don't have to understand it all at once. For example, there are eight tables called forum_somthing. If you are interested in the forum module, then obviously you need to understand these tables, and the places they link into core tables. But if you are not interested in the forum module, you can forget about them. The same is true of each activity module.
Once you take out the tables for each activity module in this way, and similarly take out the tables belonging to the enrolment plugins, question types, etc. You are left with about 50 core tables. But the good news is that even here they break down into groups that mostly you can understand together, or ignore. This page lists the core database tables in these groups. Later, it would be good to add more detailed documentation explaining some of these groups.
The database structure is defined, edited and upgraded using the XMLDB system.
Configuration
config
On this table there is stored data about the main configuration of the moodle installation, their fields are: - id - name - value
config_plugins
On this table there is stored data about the plugins that have been installed on our moodle installation, their fields are: - id - plugin - name - value
Users and their profiles
- user
- user_info_category
- user_info_field
- user_info_data
- user_lastaccess
- this is separated from the user table for performance reasons
- user_preferences
- user_private_key
The roles and capabilites system
- role
- capabilites
- context
- role_allow_assign
- role_allow_override
- role_assignments
- role_capabilities
- role_names
- role_sortorder
Courses and their organisation into categories
- course
- course_categories
- course_display
- course_meta
- course_request
Activities and their arrangement within courses
- modules
- course_allowed_modules
- course_modules
- course_sections
See also the tables belonging to particular activity modules. For example forum_*, quiz_*, etc.
Groups and groupings
- groups
- groups_members
- groupings
- groupings_groups
The logging system
- log
- log_display
Blocks system
- block
- block_instance
- block_pinned
Some particular blocks also have their own database tables. For example block_rss_client.
Events
- event_*
Backup and restore
- backup_config
- backup_courses
- backup_files
- backup_ids
- backup_log
Statistics
- stats_daily
- stats_monthly
- stats_user_daily
- stats_user_monthly
- stats_user_weekly
- stats_weekly
Tags
- tag_*
Gradebook
- grade_*
Question bank
- question
- question_answers
- question_attempts
- question_categories
- question_sessions
- question_states
See also the tables for individual question types, which all start question_.
Messaging system
- message_*
Moodle Network
- mnet_*
Caching
- cache_*
Miscellaneous
- scale
- scale_history
- sessions2
- timezone
- post
See also
- Development:Database_Schema - some automatically generated diagrams.
- Development:XMLDB_Documentation - the XMLDB system used to define, edit, and update the database structure.