Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.9, 2.0
-
Component/s: Database SQL/XMLDB
-
Labels:None
-
Database:Microsoft SQL
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
-
Fixed Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
The install script for 1.9 fails on our system when it tries to had this index.
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.mdl_course_modules' and the index name 'mdl_courmodu_idn_uix'. The duplicate key value is (<NULL>)
There is a idnumber column in the mdl_course_modules field, but it's not being used. All the values are NULL and therefore they aren't unique.
Hi Alan,
I've reviewed the course_modules definition in the install.xml file and it hasn't any UNIQUE index over idnumber. In fact, I remember we detected this problem some weeks ago and changed it to ac composite idnumber-course non-unique alternative (enforcing uniqueness by code).
Can you explain if you were installing from scratch or upgrading from XXX to YYY versions? For sure we missed to change such unique index somewhere.
TIA and ciao