aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2024-12-03 15:55:26 +0000
committerMoritz Strohm <strohm@data-quest.de>2024-12-03 15:55:26 +0000
commit43df0bbc55deb807cd780517797f2a3772553929 (patch)
tree8db81b2921a7ad056442ca73c9281644eddffd44 /db
parent2835b3b966dc60ebcf85e7bb77be9d85e24d9920 (diff)
migration 6.0.35: use a generic way to check if a column exists, fixes #4954
Closes #4954 Merge request studip/studip!3714
Diffstat (limited to 'db')
-rw-r--r--db/migrations/6.0.35_new_schedule_improvements.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/db/migrations/6.0.35_new_schedule_improvements.php b/db/migrations/6.0.35_new_schedule_improvements.php
index 2a038b9..f97292e 100644
--- a/db/migrations/6.0.35_new_schedule_improvements.php
+++ b/db/migrations/6.0.35_new_schedule_improvements.php
@@ -3,6 +3,8 @@
class NewScheduleImprovements extends Migration
{
+ use DatabaseMigrationTrait;
+
public function description()
{
return 'A bugfix migration to add colours to personal schedule entries again and to migrate schedule configurations.';
@@ -11,10 +13,12 @@ class NewScheduleImprovements extends Migration
protected function up()
{
$db = DBManager::get();
- $db->exec(
- "ALTER TABLE `schedule_entries`
- ADD COLUMN IF NOT EXISTS `colour_id` TINYINT(3) NOT NULL DEFAULT 0"
- );
+ if (!$this->columnExists('schedule_entries', 'colour_id')) {
+ $db->exec(
+ "ALTER TABLE `schedule_entries`
+ ADD COLUMN `colour_id` TINYINT(3) NOT NULL DEFAULT 0"
+ );
+ }
//Migrate the content of schedule configuration entries: