migrations/Version20240611172800.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 Version20240611172800 extends AbstractMigration
  8. {
  9.     public function getDescription(): string
  10.     {
  11.         return '';
  12.     }
  13.     public function up(Schema $schema): void
  14.     {
  15.         $this->skipIf($schema->hasTable('default_process'), 'Table default_process already exists');
  16.         $table $schema->createTable('default_process');
  17.         $table->addColumn('id'Types::GUID)->setNotnull(true);
  18.         $table->setPrimaryKey(['id']);
  19.         $table->addForeignKeyConstraint('process', ['id'], ['id'], ['onDelete' => 'CASCADE'], 'fk_process_default_process');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->skipIf(!$schema->hasTable('default_process'), 'Table default_process does not exist');
  24.         $schema->dropTable('default_process');
  25.     }
  26. }