migrations/Version20250430125600.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\Migrations\AbstractMigration;
  7. final class Version20250430125600 extends AbstractMigration
  8. {
  9.     public function getDescription(): string
  10.     {
  11.         return 'Add reimbursement_process table';
  12.     }
  13.     public function up(Schema $schema): void
  14.     {
  15.         $this->skipIf($schema->hasTable('reimbursement_process'), 'Table reimbursement_process already exists');
  16.         $table $schema->createTable('reimbursement_process');
  17.         $table->addColumn('id'Types::GUID)->setNotnull(true);
  18.         $table->addColumn('reimbursement_number'Types::STRING, ['length' => 255])->setNotnull(false);
  19.         $table->setPrimaryKey(['id']);
  20.         $table->addForeignKeyConstraint('process', ['id'], ['id'], ['onDelete' => 'CASCADE'], 'fk_process_reimbursement_process');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         $this->skipIf(!$schema->hasTable('reimbursement_process'), 'Table reimbursement_process does not exist');
  25.         $schema->dropTable('reimbursement_process');
  26.     }
  27. }