This repository has been archived on 2026-11-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
thetool/db/migrations/20240202152709_hausnummer_add_subcd.php
T

35 lines
892 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class HausnummerAddSubcd extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$table = $this->table("Hausnummer");
$table->addColumn("subcd", "integer", ["null" => true, "default" => null, "after" => "adrcd"]);
$table->addIndex(["adrcd", "subcd"]);
$table->update();
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$table = $this->table("Hausnummer");
$table->removeIndex(["adrcd", "subcd"]);
$table("Hausnummer")->removeColumn("subcd");
}
}
}