Skip to content

Commit

Permalink
Merge pull request #25922 from nextcloud/backport/25882/stable21
Browse files Browse the repository at this point in the history
[stable21] Filter out tables that does not belong to Nextcloud
  • Loading branch information
rullzer authored Mar 4, 2021
2 parents 5a39900 + 549cefe commit 27e2f06
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/private/DB/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ public function createSchema() {
/** @var string|AbstractAsset $asset */
$filterExpression = $this->getFilterExpression();
if ($asset instanceof AbstractAsset) {
return preg_match($filterExpression, $asset->getName()) !== false;
return preg_match($filterExpression, $asset->getName()) === 1;
}
return preg_match($filterExpression, $asset) !== false;
return preg_match($filterExpression, $asset) === 1;
});
return $this->connection->getSchemaManager()->createSchema();
}
Expand All @@ -210,9 +210,9 @@ protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $conn
/** @var string|AbstractAsset $asset */
$filterExpression = $this->getFilterExpression();
if ($asset instanceof AbstractAsset) {
return preg_match($filterExpression, $asset->getName()) !== false;
return preg_match($filterExpression, $asset->getName()) === 1;
}
return preg_match($filterExpression, $asset) !== false;
return preg_match($filterExpression, $asset) === 1;
});
$sourceSchema = $connection->getSchemaManager()->createSchema();

Expand Down

0 comments on commit 27e2f06

Please sign in to comment.