Skip to content

Commit 85c72d6

Browse files
author
ahuininga-orisha
committed
Update FixLandingPageStoreName.php
1 parent 7ab2fdf commit 85c72d6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Setup/Patch/Data/FixLandingPageStoreName.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public function apply(): FixLandingPageStoreName
3131
$storeTable = $this->moduleDataSetup->getTable('emico_attributelanding_page_store');
3232
$pageTable = $this->moduleDataSetup->getTable('emico_attributelanding_page');
3333

34+
$select = $connection->select()
35+
->join(['p' => $pageTable], 's.page_id = p.page_id', ['name' => 'p.name'])
36+
->where('s.name IS NULL');
37+
3438
$connection->query(
35-
sprintf(
36-
'UPDATE %s s JOIN %s p ON s.page_id = p.page_id SET s.name = p.name WHERE s.name IS NULL',
37-
$storeTable,
38-
$pageTable
39-
)
39+
$connection->updateFromSelect($select, ['s' => $storeTable])
4040
);
4141

4242
$this->moduleDataSetup->endSetup();

0 commit comments

Comments
 (0)