Skip to content

Commit

Permalink
[shopsys] moved migration of stock settings from project-base to fram…
Browse files Browse the repository at this point in the history
…ework (#3401)
  • Loading branch information
TomasLudvik authored Sep 2, 2024
1 parent 8a516d8 commit a5e1453
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/Migrations/Version20240827110317.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

declare(strict_types=1);

namespace Shopsys\FrameworkBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class Version20240827110317 extends AbstractMigration implements ContainerAwareInterface
{
use MultidomainMigrationTrait;

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function up(Schema $schema): void
{
if ($this->isAppMigrationNotInstalledRemoveIfExists('Version20200129140317')) {
foreach ($this->getAllDomainIds() as $domainId) {
$this->sql(
'INSERT INTO "setting_values" ("name", "domain_id", "value", "type") VALUES
(\'transferDaysBetweenStocks\', :domainId, \'1\', \'integer\')',
['domainId' => $domainId],
);
}
}
}

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function down(Schema $schema): void
{
}
}

0 comments on commit a5e1453

Please sign in to comment.