Add new file

This commit is contained in:
Luca Haid
2025-09-02 11:27:03 +00:00
parent 229f4b8638
commit 2b03e0f3a3

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class WorkorderAddInterventionTypes extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$tenantConfigTable = $this->table('WorkorderTenantConfig');
if (!$tenantConfigTable->hasColumn('interventionTypes')) {
$tenantConfigTable->addColumn('interventionTypes', 'text', ['null' => true, 'default' => null, 'after' => 'workorderCreationFilters'])
->save();
}
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$tenantConfigTable = $this->table('WorkorderTenantConfig');
if ($tenantConfigTable->hasColumn('interventionTypes')) {
$tenantConfigTable->removeColumn('interventionTypes')->save();
}
}
}
}