Skip to content

Commit

Permalink
Merge pull request #2751 from coreshop/coding-standard/refactor-4.0
Browse files Browse the repository at this point in the history
[CS] Refactor
  • Loading branch information
dpfaffenbauer authored Nov 11, 2024
2 parents 4efb0df + 747b7c3 commit 3a77875
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function findForObject(Concrete $product, string $fieldName): array
public function findForObjectAndStore(
Concrete $product,
string $fieldName,
StoreInterface $store
StoreInterface $store,
): ?ProductStoreValuesInterface {
return $this->createQueryBuilder('o')
->andWhere('o.product = :product')
Expand All @@ -71,6 +71,6 @@ public function findForObjectAndStore(
->setParameter('fieldName', $fieldName)
->getQuery()
->getOneOrNullResult()
;
;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

declare(strict_types=1);

/*
* CoreShop
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - CoreShop Commercial License (CCL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) CoreShop GmbH (https://www.coreshop.org)
* @license https://www.coreshop.org/license GPLv3 and CCL
*
*/

namespace CoreShop\Bundle\CoreBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
Expand All @@ -23,9 +37,9 @@ public function up(Schema $schema): void
return;
}

$this->addSql("ALTER TABLE coreshop_product_store_values ADD fieldName VARCHAR(255) NOT NULL;");
$this->addSql("DROP INDEX product_store ON coreshop_product_store_values;");
$this->addSql("CREATE UNIQUE INDEX product_store ON coreshop_product_store_values (product, store, fieldName);");
$this->addSql('ALTER TABLE coreshop_product_store_values ADD fieldName VARCHAR(255) NOT NULL;');
$this->addSql('DROP INDEX product_store ON coreshop_product_store_values;');
$this->addSql('CREATE UNIQUE INDEX product_store ON coreshop_product_store_values (product, store, fieldName);');
$this->addSql("UPDATE coreshop_product_store_values SET fieldName='storeValues';");
}

Expand Down

0 comments on commit 3a77875

Please sign in to comment.