Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
0b84fb7b
Commit
0b84fb7b
authored
Nov 14, 2018
by
Nathan Nguyen
Browse files
MDL-69572 mod_book : add bookid index to book_chapters
parent
5486b031
Changes
3
Hide whitespace changes
Inline
Side-by-side
mod/book/db/install.xml
View file @
0b84fb7b
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB
PATH=
"mod/book/db"
VERSION=
"20
1
20
515
"
COMMENT=
"XMLDB file for Moodle mod_book"
<XMLDB
PATH=
"mod/book/db"
VERSION=
"2020
0907
"
COMMENT=
"XMLDB file for Moodle mod_book"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"../../../lib/xmldb/xmldb.xsd"
>
...
...
@@ -39,6 +39,9 @@
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
</KEYS>
<INDEXES>
<INDEX
NAME=
"bookid"
UNIQUE=
"false"
FIELDS=
"bookid"
/>
</INDEXES>
</TABLE>
</TABLES>
</XMLDB>
mod/book/db/upgrade.php
View file @
0b84fb7b
...
...
@@ -30,7 +30,9 @@ defined('MOODLE_INTERNAL') || die;
* @return bool always true
*/
function
xmldb_book_upgrade
(
$oldversion
)
{
global
$CFG
;
global
$CFG
,
$DB
;
$dbman
=
$DB
->
get_manager
();
// Automatically generated Moodle v3.5.0 release upgrade line.
// Put any upgrade step following this.
...
...
@@ -47,5 +49,14 @@ function xmldb_book_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
if
(
$oldversion
<
2021052501
)
{
$table
=
new
xmldb_table
(
'book_chapters'
);
$index
=
new
xmldb_index
(
'bookid'
,
XMLDB_INDEX_NOTUNIQUE
,
[
'bookid'
]);
if
(
!
$dbman
->
index_exists
(
$table
,
$index
))
{
$dbman
->
add_index
(
$table
,
$index
);
}
upgrade_mod_savepoint
(
true
,
2021052501
,
'book'
);
}
return
true
;
}
mod/book/version.php
View file @
0b84fb7b
...
...
@@ -25,6 +25,6 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$plugin
->
component
=
'mod_book'
;
// Full name of the plugin (used for diagnostics)
$plugin
->
version
=
202105250
0
;
// The current module version (Date: YYYYMMDDXX)
$plugin
->
version
=
202105250
1
;
// The current module version (Date: YYYYMMDDXX)
$plugin
->
requires
=
2021052500
;
// Requires this Moodle version
$plugin
->
cron
=
0
;
// Period for cron to check this module (secs)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment