29 lines
1012 B
PHP
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();
|
|
}
|
|
}
|
|
}
|
|
}
|