Adb wohneinheit/add contacts
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user