Added missing column

This commit is contained in:
Luca Haid
2025-01-31 16:22:09 +01:00
parent 538f69b4fc
commit 2e3627783e
2 changed files with 23 additions and 0 deletions
@@ -7,6 +7,7 @@
* *
* @property int $id Unique identifier for the warehouse order * @property int $id Unique identifier for the warehouse order
* @property string $orderNumber Unique order number * @property string $orderNumber Unique order number
* @property int $distributorId ID of the distributor associated with the order
* @property string $delAddrCity City of the delivery address * @property string $delAddrCity City of the delivery address
* @property string $delAddrEMail Email associated with the delivery address * @property string $delAddrEMail Email associated with the delivery address
* @property string $delAddrLine Line of the delivery address * @property string $delAddrLine Line of the delivery address
@@ -21,6 +22,7 @@
class WarehouseOrderModel extends TTCrudBaseModel { class WarehouseOrderModel extends TTCrudBaseModel {
public int $id; public int $id;
public string $orderNumber; public string $orderNumber;
public int $distributorId;
public string $delAddrCity; public string $delAddrCity;
public string $delAddrEMail; public string $delAddrEMail;
public string $delAddrLine; public string $delAddrLine;
@@ -0,0 +1,21 @@
<?php declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class WarehouseModify10 extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$table = $this->table("WarehouseOrder");
$table->addColumn("distributorId", "integer", ["null" => false]);
$table->save();;
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
$table = $this->table("WarehouseOrder");
$table->removeColumn("distributorId");
$table->save();;
}
}
}