mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 20:53:53 +01:00
MDL-71696 question: Align new tables with install/upgrade
Amended because, in all cases, install.xml wins and we have make upgrade.php to match it... But in the question_versions->status case, that needs to be NOT_NULL, so upgrade was correct and install.xml has been changed for it. Note this has been changed without using the editor because it has been detected that there are other changes in the xml file that have been added manually, we'll create a "reconcile" issue to fix that (mainly whitespace). So, yes, please, always use the editor.
This commit is contained in:
parent
aafeca8f75
commit
1d0609bbdd
@ -1453,7 +1453,7 @@
|
||||
<FIELD NAME="questionbankentryid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="ID of the question bank entry this question version is part of."/>
|
||||
<FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" SEQUENCE="false" COMMENT="Version number for the question where the first version is always 1."/>
|
||||
<FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The question ID."/>
|
||||
<FIELD NAME="status" TYPE="char" LENGTH="10" NOTNULL="false" DEFAULT="ready" SEQUENCE="false" COMMENT="If the question is ready, hidden or draft"/>
|
||||
<FIELD NAME="status" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="ready" SEQUENCE="false" COMMENT="If the question is ready, hidden or draft"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
|
@ -3844,7 +3844,7 @@ privatefiles,moodle|/user/files.php';
|
||||
|
||||
// Adding fields to table question_versions.
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
|
||||
$table->add_field('questionbankentryid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('questionbankentryid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 0);
|
||||
$table->add_field('version', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 1);
|
||||
$table->add_field('questionid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 0);
|
||||
$table->add_field('status', XMLDB_TYPE_CHAR, '10', null, XMLDB_NOTNULL, null, 'ready');
|
||||
@ -3867,8 +3867,8 @@ privatefiles,moodle|/user/files.php';
|
||||
$table->add_field('usingcontextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 0);
|
||||
$table->add_field('component', XMLDB_TYPE_CHAR, '100', null, null, null, null);
|
||||
$table->add_field('questionarea', XMLDB_TYPE_CHAR, '50', null, null, null, null);
|
||||
$table->add_field('itemid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('questionbankentryid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('itemid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
|
||||
$table->add_field('questionbankentryid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 0);
|
||||
$table->add_field('version', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
|
||||
|
||||
// Adding keys to table question_references.
|
||||
@ -3889,14 +3889,13 @@ privatefiles,moodle|/user/files.php';
|
||||
$table->add_field('usingcontextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 0);
|
||||
$table->add_field('component', XMLDB_TYPE_CHAR, '100', null, null, null, null);
|
||||
$table->add_field('questionarea', XMLDB_TYPE_CHAR, '50', null, null, null, null);
|
||||
$table->add_field('itemid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
|
||||
$table->add_field('itemid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
|
||||
$table->add_field('questionscontextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 0);
|
||||
$table->add_field('filtercondition', XMLDB_TYPE_TEXT, null, null, null, null, null);
|
||||
|
||||
// Adding keys to table question_set_references.
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
|
||||
$table->add_key('usingcontextid', XMLDB_KEY_FOREIGN, ['usingcontextid'], 'context', ['id']);
|
||||
$table->add_key('itemid', XMLDB_KEY_FOREIGN, ['itemid'], 'quiz_slots', ['id']);
|
||||
$table->add_key('questionscontextid', XMLDB_KEY_FOREIGN, ['questionscontextid'], 'context', ['id']);
|
||||
|
||||
// Conditionally launch create table for question_set_references.
|
||||
|
Loading…
x
Reference in New Issue
Block a user