Warehouse project/fix

This commit is contained in:
Luca Haid
2025-12-03 14:08:44 +00:00
parent ff070bac73
commit 594a926262
10 changed files with 1560 additions and 735 deletions
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddWohneinheitDocumentation extends AbstractMigration
{
public function up(): void
{
// AddressDB modifications - add documentation table for Wohneinheit
if ($this->getEnvironment() == "addressdb") {
$table = $this->table('WohneinheitDocumentation', ['id' => 'id', 'primary_key' => 'id']);
if (!$table->exists()) {
$table
->addColumn('wohneinheit_id', 'integer', ['null' => false])
->addColumn('fileId', 'integer', ['null' => false])
->addColumn('description', 'text', ['null' => true])
->addColumn('documentType', 'string', ['limit' => 100, 'null' => false, 'default' => 'photo'])
->addColumn('create', 'integer', ['null' => false])
->addColumn('createBy', 'integer', ['null' => false])
->addIndex(['wohneinheit_id'], ['name' => 'wohneinheit_id_idx'])
->addIndex(['fileId'], ['name' => 'fileId_idx'])
->create();
}
}
}
public function down(): void
{
// AddressDB modifications
if ($this->getEnvironment() == "addressdb") {
$table = $this->table('WohneinheitDocumentation');
if ($table->exists()) {
$table->drop()->save();
}
}
}
}