[Added] multilang tables
Dieser Commit ist enthalten in:
Ursprung
d4bfda93b7
Commit
2162954e80
65
migration/data/Version20241028172608.php
Normale Datei
65
migration/data/Version20241028172608.php
Normale Datei
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\ManufacturerInformation\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\DBAL\Types\StringType;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20241028172608 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return 'Adds multilang tables';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
$this->connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
|
||||
|
||||
$this->d3AddLongdescMultilangColumnsToOxmanufacturers($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 d3AddLongdescMultilangColumnsToOxmanufacturers(Schema $schema){
|
||||
$table = !$schema->hasTable('oxmanufacturers') ?
|
||||
$schema->createTable('oxmanufacturers') :
|
||||
$schema->getTable('oxmanufacturers');
|
||||
|
||||
// lang 1
|
||||
if (!$table->hasColumn('D3DESCRIPTION_1')) {
|
||||
$table->addColumn('D3DESCRIPTION_1', (new StringType())->getName())
|
||||
->setLength(255)
|
||||
->setNotnull(true);
|
||||
}
|
||||
|
||||
// lang 2
|
||||
if (!$table->hasColumn('D3DESCRIPTION_2')) {
|
||||
$table->addColumn('D3DESCRIPTION_2', (new StringType())->getName())
|
||||
->setLength(255)
|
||||
->setNotnull(true);
|
||||
}
|
||||
|
||||
// lang 3
|
||||
if (!$table->hasColumn('D3DESCRIPTION_3')) {
|
||||
$table->addColumn('D3DESCRIPTION_3', (new StringType())->getName())
|
||||
->setLength(255)
|
||||
->setNotnull(true);
|
||||
}
|
||||
}
|
||||
}
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren