31 lines
974 B
PHP
31 lines
974 B
PHP
<?php /** @noinspection ALL */
|
|
declare(strict_types = 1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class WarehouseModify24 extends AbstractMigration {
|
|
public function up(): void {
|
|
if ($this->getEnvironment() == "thetool") {
|
|
$WarehouseShippingNote = $this->table("WarehouseShippingNote");
|
|
|
|
if (!$WarehouseShippingNote->hasColumn("metadata")) {
|
|
$WarehouseShippingNote
|
|
->addColumn("metadata", "json", ["null" => true, "default" => null, "after" => "type"])
|
|
->update();
|
|
}
|
|
}
|
|
}
|
|
|
|
public function down(): void {
|
|
if ($this->getEnvironment() == "thetool") {
|
|
$WarehouseShippingNote = $this->table("WarehouseShippingNote");
|
|
|
|
if ($WarehouseShippingNote->hasColumn("metadata")) {
|
|
$WarehouseShippingNote
|
|
->removeColumn("metadata")
|
|
->update();
|
|
}
|
|
}
|
|
}
|
|
}
|