Adb wohneinheit/add contacts

This commit is contained in:
Luca Haid
2025-09-16 14:10:03 +00:00
parent fd39ba1db2
commit 0496103841
6 changed files with 371 additions and 2 deletions
@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AdbWohneinheitAddContact extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == 'addressdb') {
$table = $this->table('Wohneinheit');
if (!$table->hasColumn('contact')) {
$table->addColumn('contact', 'text', [
'null' => true,
'default' => null,
'after' => 'note'
])
->save();
}
}
}
public function down(): void
{
if ($this->getEnvironment() == 'addressdb') {
$table = $this->table('Wohneinheit');
if ($table->hasColumn('contact')) {
$table->removeColumn('contact')
->save();
}
}
}
}