Files
thetool/db/migrations/20251005184454_calendar_add_fields_calendar_admin.php
Daniel Spitzer b2733004c9 Kalenderupdate
* Komplette Verwaltung von Kalender Rechte von internen und externen Mitarbeiteren
2025-10-05 20:51:15 +02:00

44 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CalendarAddFieldsCalendarAdmin extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
//calendar_admin
$table = $this->table('Calendar');
if (!$table->hasColumn('calendar_admin')) {
$table
->addColumn('calendar_admin', 'boolean', [
'default' => 0,
'after' => 'active',
'comment' => 'User has calendar admin rights',
])
->update();
}
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('Calendar');
if ($table->hasColumn('calendar_admin')) {
$table->removeColumn('calendar_admin');
}
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}