fix: creating shipping notes

This commit is contained in:
Luca Haid
2025-04-08 15:57:01 +02:00
parent 15668a07cd
commit 526260a324
2 changed files with 26 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
class WarehouseShippingNoteModel extends TTCrudBaseModel {
public int $id;
public ?int $billingAddressId;
public string $type;
public ?string $type;
public string $deliveryAddressName;
public string $deliveryAddressLine;
public string $deliveryAddressPLZ;

View File

@@ -0,0 +1,25 @@
<?php declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class WarehouseModify18 extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$WarehouseShippingNoteTable = $this->table("WarehouseShippingNote");
$WarehouseShippingNoteTable
->changeColumn("type", "string", ["limit" => 255, "default" => null])
->save();
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$WarehouseShippingNoteTable = $this->table("WarehouseShippingNote");
if ($WarehouseShippingNoteTable->hasColumn("type")) {
$WarehouseShippingNoteTable
->changeColumn("type", "string", ["limit" => 255])
->save();
}
}
}
}