Merge branch 'spidev' into 'master'

Pop Erweiterung auf Adressen

See merge request fronk/thetool!2099
This commit is contained in:
Daniel Spitzer
2026-02-20 10:37:02 +00:00
7 changed files with 208 additions and 10 deletions

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PopAddAddressFields extends AbstractMigration
{
public function up(): void
{
$table = $this->table('Pop');
if (!$table->hasColumn('zip')) {
$table->addColumn('zip', 'string', ['null' => true, 'limit' => 10, 'after' => 'location']);
}
if (!$table->hasColumn('city')) {
$table->addColumn('city', 'string', ['null' => true, 'limit' => 255, 'after' => 'zip']);
}
if (!$table->hasColumn('street')) {
$table->addColumn('street', 'string', ['null' => true, 'limit' => 255, 'after' => 'city']);
}
if (!$table->hasColumn('number')) {
$table->addColumn('number', 'string', ['null' => true, 'limit' => 20, 'after' => 'street']);
}
$table->update();
}
public function down(): void
{
$table = $this->table('Pop');
$table->removeColumn('zip')
->removeColumn('city')
->removeColumn('street')
->removeColumn('number')
->update();
}
}