Files
thetool/db/migrations/20250916153000_adb_wohneinheit_add_contact.php
2025-09-16 14:10:03 +00:00

35 lines
877 B
PHP

<?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();
}
}
}
}