<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260401100000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add asset_type column to truck_model';
}
public function up(Schema $schema): void
{
$table = $schema->getTable('truck_model');
if (!$table->hasColumn('asset_type')) {
$this->addSql('ALTER TABLE truck_model ADD asset_type VARCHAR(50) DEFAULT NULL');
}
}
public function down(Schema $schema): void
{
$table = $schema->getTable('truck_model');
if ($table->hasColumn('asset_type')) {
$this->addSql('ALTER TABLE truck_model DROP asset_type');
}
}
}