33 lines
857 B
PHP
33 lines
857 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class HausnummerAddVisibility extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
$table = $this->table("Hausnummer");
|
|
$table->addColumn("visibility", "enum", ["null" => false, "values" => "public,private,none", "default" => "public", "after" => "freigabe"]);
|
|
$table->addIndex("visibility");
|
|
$table->update();
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
if($this->getEnvironment() == "thetool") {
|
|
|
|
}
|
|
|
|
if($this->getEnvironment() == "addressdb") {
|
|
$this->table("Hausnummer")->removeColumn("visibility")->save();
|
|
}
|
|
}
|
|
}
|