Files
thetool/db/migrations/20251125100000_warehouse_offer_add_validity.php
2025-12-02 14:46:22 +00:00

34 lines
899 B
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class WarehouseOfferAddValidity extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table('WarehouseOffer');
if (!$table->hasColumn('validity')) {
$table->addColumn('validity', 'integer', [
'null' => true,
'default' => null,
'after' => 'status',
]);
$table->update();
}
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table('WarehouseOffer');
if ($table->hasColumn('validity')) {
$table->removeColumn('validity');
$table->update();
}
}
}
}