[Added] migration
Cette révision appartient à :
Parent
b1512fa986
révision
3a09944479
54
migration/data/Version20241023154223.php
Fichier normal
54
migration/data/Version20241023154223.php
Fichier normal
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\ManufacturerInformation\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\DBAL\Types\DateTimeType;
|
||||
use Doctrine\DBAL\Types\DateType;
|
||||
use Doctrine\DBAL\Types\IntegerType;
|
||||
use Doctrine\DBAL\Types\StringType;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20241023154223 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return 'Adds the D3 manufacturer longdesc column';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
$this->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);
|
||||
}
|
||||
}
|
||||
}
|
Chargement…
x
Référencer dans un nouveau ticket
Bloquer un utilisateur