34 lines
899 B
PHP
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();
|
|
}
|
|
}
|
|
}
|
|
}
|