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 (#3340)

Co-authored-by: Milan Staňo <milan.stano@shopsys.com>
Co-authored-by: Tomáš Ludvik <tomas.ludvik@shopsys.com>
  • Loading branch information
3 people committed Aug 30, 2024
1 parent e070b9a commit c786172
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 c786172

Please sign in to comment.