Files
thetool/db/migrations/20250320130000_warehouse_modify_15.php
2025-03-20 12:14:34 +00:00

26 lines
1.0 KiB
PHP

<?php declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class WarehouseModify15 extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$WarehouseShippingNoteTable = $this->table("WarehouseShippingNote");
$WarehouseShippingNoteTable
->changeColumn("billingAddressId", "integer", ["null" => true])
->changeColumn("status", "enum", ["values" => ['new', 'in_progress', 'accepted', 'invoiced', 'cancelled', 'on_hold']])
->save();
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$WarehouseShippingNoteTable = $this->table("WarehouseShippingNote");
$WarehouseShippingNoteTable
->changeColumn("billingAddressId", "integer", ["null" => false])
->changeColumn("status", "enum", ["values" => ['new', 'in_progress', 'accepted', 'invoiced']])
->save();
}
}
}