diff options
| -rw-r--r-- | db/migrations/6.0.35_new_schedule_improvements.php | 12 |
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: |
