Skip to content

Commit

Permalink
add migration from v2, move migrations to make space
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Jun 24, 2024
1 parent 3a6af6d commit 6abd1ac
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 39 deletions.
24 changes: 24 additions & 0 deletions migrations/050_update_courseware_payload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
class UpdateCoursewarePayload extends Migration
{
public function up()
{
$db = DBManager::get();

$link = str_replace('/', '\\/',
PluginEngine::getLink('opencast', [], 'redirect/perform/video/')
);

$stmt = $db->exec($query = "UPDATE cw_blocks
SET payload = REGEXP_REPLACE(payload, '\"url\":\".*\\\\/(.*?)\",\"', '\"url\":\"" .
$link
. "\\\\1\",\"')
WHERE block_type = 'plugin-opencast-video'
");
}

public function down()
{

}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ public function up()
'value' => $config_id
]);

$stmt = $db->prepare('INSERT IGNORE INTO config (field, value, section, type, `range`, mkdate, chdate, description)
VALUES (:name, :value, :section, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)');
$stmt->execute([
'name' => 'OPENCAST_ALLOW_SCHEDULER',
'section' => 'opencast',
'description' => 'Sollen Aufzeichnungen geplant werden können?',
'range' => 'global',
'type' => 'boolean',
'value' => true
]);

SimpleOrMap::expireTableScheme();
}
Expand All @@ -34,6 +44,7 @@ public function down()
$db = DBManager::get();

$db->exec("DELETE FROM config WHERE field = 'OPENCAST_DEFAULT_SERVER'");
$db->exec("DELETE FROM config WHERE field = 'OPENCAST_ALLOW_SCHEDULER'");

SimpleOrMap::expireTableScheme();
}
Expand Down
39 changes: 0 additions & 39 deletions migrations/055_add_config_for_scheduler.php

This file was deleted.

0 comments on commit 6abd1ac

Please sign in to comment.