Files
thetool/db/migrations/20250507160000_warehouse_modify_21.php
2025-05-07 16:39:15 +02:00

29 lines
1012 B
PHP

<?php /** @noinspection ALL */
declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class WarehouseModify21 extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$WarehouseArticlePacket = $this->table("WarehouseArticlePacket");
if (!$WarehouseArticlePacket->hasColumn("externalArticleNumber")) {
$WarehouseArticlePacket
->addColumn("externalArticleNumber", "string", ["limit" => 255, "null" => true])
->update();
}
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$WarehouseArticlePacket = $this->table("WarehouseArticlePacket");
if ($WarehouseArticlePacket->hasColumn("externalArticleNumber")) {
$WarehouseArticlePacket
->removeColumn("externalArticleNumber")
->update();
}
}
}
}