Files
thetool/db/migrations/20240718123809_address_add_birthdate.php
2024-07-18 15:05:24 +02:00

32 lines
768 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddressAddBirthdate extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Address");
$table->addColumn("birthdate", "date", ["null" => true, "default" => null, "after" => "uid"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Address")->removeColumn("birthdate")->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}