Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #133: delete unique index (take 2) #134

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
</KEYS>
<INDEXES>
<INDEX NAME="coursemoduleid" UNIQUE="false" FIELDS="coursemoduleid" COMMENT="For quick access via course-module (e.g. when displaying course module settings page and we need to determine whether anyone has completed it)."/>
<INDEX NAME="userid-coursemoduleid" UNIQUE="true" FIELDS="userid, coursemoduleid"/>
</INDEXES>
</TABLE>
<TABLE NAME="local_recompletion_qa" COMMENT="archive of quiz attempts table">
Expand Down
14 changes: 14 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -973,5 +973,19 @@ function xmldb_local_recompletion_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2023112100, 'local', 'recompletion');
}

if ($oldversion < 2023112600) {
// Define table local_recompletion_cmv to be created.
$table = new xmldb_table('local_recompletion_cmv');
$index = new xmldb_index('userid-coursemoduleid', XMLDB_INDEX_UNIQUE, ['userid', 'coursemoduleid']);

// Conditionally launch drop index.
if ($dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}

// Recompletion savepoint reached.
upgrade_plugin_savepoint(true, 2023112600, 'local', 'recompletion');
}

return true;
}
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2023112100;
$plugin->release = 2023112100;
$plugin->version = 2023112600;
$plugin->release = 2023112600;
$plugin->maturity = MATURITY_STABLE;
$plugin->requires = 2022112805; // Requires 4.1.
$plugin->component = 'local_recompletion';
Expand Down
Loading