Skip to content

Commit b85bd96

Browse files
committed
Remove data from 'wrong' table
1 parent 19047da commit b85bd96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Console/Command/CleanUpAttributesAndValuesWithoutParentCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public function execute(InputInterface $input, OutputInterface $output)
7676
$eavTable = $this->resourceConnection->getTableName('eav_attribute');
7777
$entityValueTable = $this->resourceConnection->getTableName($code . '_entity_' . $type);
7878
$query = "SELECT * FROM $entityValueTable WHERE `attribute_id` NOT IN(SELECT attribute_id"
79-
. " FROM `$eavTable` WHERE entity_type_id = " . $entityType->getEntityTypeId() . ")";
79+
. " FROM `$eavTable` WHERE entity_type_id = " . $entityType->getEntityTypeId() . " AND backend_type = '$type')";
8080
$results = $db->fetchAll($query);
8181
$output->writeln("Clean up " . count($results) . " rows in $entityValueTable");
8282

8383
if (!$isDryRun && count($results) > 0) {
8484
$db->query("DELETE FROM $entityValueTable WHERE `attribute_id` NOT IN(SELECT attribute_id"
85-
. " FROM `$eavTable` WHERE entity_type_id = " . $entityType->getEntityTypeId() . ")");
85+
. " FROM `$eavTable` WHERE entity_type_id = " . $entityType->getEntityTypeId() . " AND backend_type = '$type')");
8686
}
8787
}
8888
}

0 commit comments

Comments
 (0)