Moodle

Add referential keys to the new group tables

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.8
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Environment:
    Any
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

They only contain the mandatory PK, but it's a strongly referential model, so they must have all the FK keys defined. It will allow XMLDB to create the underlying indexes and everything will be fast, for sure!

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

this will block the main groups issue.

Show
Eloy Lafuente (stronk7) added a comment - this will block the main groups issue.
Hide
Eloy Lafuente (stronk7) added a comment -

This indexes/key have been added:

  • groups_members: unique index (groupid, userid)
  • groups_courses_groups: unique index (courseid, groupid), foreign key (courseid), foreign key (groupid)
  • groups_courses_grouping: unique index (courseid, groupingid), foreign key (courseid), foreign key (groupingid)
  • groups_groupings_groups: unique index (groupingid, groupid), foreign key (groupingid), foreign key (groupid).

Note that all the above foreign keys aren't created (although it's better to have them well defined). Instead, underlying non-unique indexes are created automatically.

Closing this....upgrade tested over MySQL, PG and MSSQL.

Show
Eloy Lafuente (stronk7) added a comment - This indexes/key have been added:
  • groups_members: unique index (groupid, userid)
  • groups_courses_groups: unique index (courseid, groupid), foreign key (courseid), foreign key (groupid)
  • groups_courses_grouping: unique index (courseid, groupingid), foreign key (courseid), foreign key (groupingid)
  • groups_groupings_groups: unique index (groupingid, groupid), foreign key (groupingid), foreign key (groupid).
Note that all the above foreign keys aren't created (although it's better to have them well defined). Instead, underlying non-unique indexes are created automatically. Closing this....upgrade tested over MySQL, PG and MSSQL.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: