Files
thetool/db/migrations/20241022114654_create_construction_consent.php
Frank Schubert 6c0d334bbc WIP tmp
2024-11-07 16:28:05 +01:00

53 lines
2.5 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateConstructionConsent extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("ConstructionConsent");
$table->addColumn("termination_id", "integer", ["null" => false]);
$table->addColumn("adb_hausnummer_id", "integer", ["null" => true, "default" => null]);
$table->addColumn("adb_strasse_id", "integer", ["null" => true, "default" => null]);
$table->addColumn("object_type", "enum", ["null" => false, "default" => "building", "values" => "building,street"]);
$table->addColumn("ez", "string", ["null" => true, "default" => null, "limit" => 32]);
$table->addColumn("owner_name", "string", ["null" => true, "default" => null, "limit" => "255"]);
$table->addColumn("owner_street", "string", ["null" => true, "default" => null, "limit" => "64"]);
$table->addColumn("owner_zip", "string", ["null" => true, "default" => null, "limit" => "32"]);
$table->addColumn("owner_city", "string", ["null" => true, "default" => null, "limit" => "64"]);
$table->addColumn("owner_country", "string", ["null" => true, "default" => null, "limit" => "64"]);
$table->addColumn("owner_phone", "string", ["null" => true, "default" => null, "limit" => "64"]);
$table->addColumn("owner_fax", "string", ["null" => true, "default" => null, "limit" => "64"]);
$table->addColumn("owner_email", "string", ["null" => true, "default" => null, "limit" => "64"]);
$table->addColumn("status", "enum", ["null" => false, "default" => "new", "values" => "new,requested,answered"]);
$table->addColumn("result", "enum", ["null" => true, "default" => null, "values" => "success,failure"]);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("ConstructionConsent")->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}