<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
final class Version20250430125600 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add reimbursement_process table';
}
public function up(Schema $schema): void
{
$this->skipIf($schema->hasTable('reimbursement_process'), 'Table reimbursement_process already exists');
$table = $schema->createTable('reimbursement_process');
$table->addColumn('id', Types::GUID)->setNotnull(true);
$table->addColumn('reimbursement_number', Types::STRING, ['length' => 255])->setNotnull(false);
$table->setPrimaryKey(['id']);
$table->addForeignKeyConstraint('process', ['id'], ['id'], ['onDelete' => 'CASCADE'], 'fk_process_reimbursement_process');
}
public function down(Schema $schema): void
{
$this->skipIf(!$schema->hasTable('reimbursement_process'), 'Table reimbursement_process does not exist');
$schema->dropTable('reimbursement_process');
}
}