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