mirror of
https://github.com/moodle/moodle.git
synced 2025-01-30 03:58:34 +01:00
Upgrades to tag tables
This commit is contained in:
parent
23281a6ac3
commit
705789bda6
@ -1050,6 +1050,28 @@ $moodle_capabilities = array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/tag:create' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'legacy' => array(
|
||||
'student' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/tag:edit' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'legacy' => array(
|
||||
'student' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -1595,12 +1595,13 @@
|
||||
<KEY NAME="newgradeitem" TYPE="foreign" FIELDS="newgradeitem" REFTABLE="grade_import_newitem" REFFIELDS="id" PREVIOUS="itemid"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="tag" COMMENT="tag table" PREVIOUS="grade_import_values" NEXT="tag_correlation">
|
||||
<TABLE NAME="tag" COMMENT="Tag table - this generic table will replace the old "tags" table." PREVIOUS="grade_import_values" NEXT="tag_correlation">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
|
||||
<FIELD NAME="userid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
|
||||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="tagtype"/>
|
||||
<FIELD NAME="tagtype" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="description"/>
|
||||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="rawname"/>
|
||||
<FIELD NAME="rawname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The raw, unnormalised name for the tag as entered by users" PREVIOUS="name" NEXT="tagtype"/>
|
||||
<FIELD NAME="tagtype" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="rawname" NEXT="description"/>
|
||||
<FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="tagtype" NEXT="descriptionformat"/>
|
||||
<FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="flag"/>
|
||||
<FIELD NAME="flag" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="a tag can be 'flagged' as inappropriate" PREVIOUS="descriptionformat" NEXT="timemodified"/>
|
||||
@ -1669,4 +1670,4 @@
|
||||
</SENTENCES>
|
||||
</STATEMENT>
|
||||
</STATEMENTS>
|
||||
</XMLDB>
|
||||
</XMLDB>
|
||||
|
@ -1520,6 +1520,19 @@ function xmldb_main_upgrade($oldversion=0) {
|
||||
}
|
||||
|
||||
|
||||
if ($result && $oldversion < 2007073103) {
|
||||
|
||||
/// Define field rawname to be added to tag
|
||||
$table = new XMLDBTable('tag');
|
||||
$field = new XMLDBField('rawname');
|
||||
$field->setAttributes(XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null, 'name');
|
||||
|
||||
/// Launch add field rawname
|
||||
$result = $result && add_field($table, $field);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
/// drop old gradebook tables
|
||||
if ($result && $oldversion < 2007072209) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2007073101; // YYYYMMDD = date
|
||||
$version = 2007073103; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.9 dev'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user