Skip to content
Snippets Groups Projects
Commit 20834cb3 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

adjust migration to prevent errors (adjusts fe081811), re #736

parent 9257df79
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,14 @@ final class AddIndexToCwUserProgressesV50 extends Migration ...@@ -8,6 +8,14 @@ final class AddIndexToCwUserProgressesV50 extends Migration
public function up() public function up()
{ {
// avoid running this migration twice
$query = "SHOW INDEX FROM `cw_user_progresses` WHERE Key_name = 'block_id'";
$result = DBManager::get()->query($query);
if ($result && $result->rowCount() > 0) {
return;
}
$query = "ALTER TABLE `cw_user_progresses` $query = "ALTER TABLE `cw_user_progresses`
ADD INDEX `block_id` (`block_id`)"; ADD INDEX `block_id` (`block_id`)";
DBManager::get()->exec($query); DBManager::get()->exec($query);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment