From 3a09944479edc397664f50602664038c462801df Mon Sep 17 00:00:00 2001 From: MaxBuhe01 Date: Wed, 23 Oct 2024 20:19:34 +0200 Subject: [PATCH] [Added] migration --- migration/data/Version20241023154223.php | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 migration/data/Version20241023154223.php diff --git a/migration/data/Version20241023154223.php b/migration/data/Version20241023154223.php new file mode 100644 index 0000000..03ad820 --- /dev/null +++ b/migration/data/Version20241023154223.php @@ -0,0 +1,54 @@ +connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); + + $this->d3AddLongdescColumnToOxmanufacturers($schema); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + + } + + /** + * @param Schema $schema + * @return void + * @throws \Doctrine\DBAL\Schema\SchemaException + */ + public function d3AddLongdescColumnToOxmanufacturers(Schema $schema){ + $table = !$schema->hasTable('oxmanufacturers') ? + $schema->createTable('oxmanufacturers') : + $schema->getTable('oxmanufacturers'); + + // Beschreibung + if (!$table->hasColumn('D3DESCRIPTION')) { + $table->addColumn('D3DESCRIPTION', (new StringType())->getName()) + ->setLength(255) + ->setNotnull(true); + } + } +}