Skip to content

Commit

Permalink
ignore shadow translations tables *_translations
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 28, 2024
1 parent 0f28cba commit 58158c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Utility/TableScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(Connection $connection, ?array $ignore = null)
{
$this->connection = $connection;
if ($ignore === null) {
$ignore = ['i18n', 'cake_sessions', 'sessions', '/phinxlog/'];
$ignore = ['i18n', 'cake_sessions', 'sessions', '/phinxlog/', '/_translations$/'];
}
$this->ignore = $ignore;
}
Expand All @@ -64,7 +64,7 @@ public function listAll(): array
{
$schema = $this->connection->getSchemaCollection();
$tables = $schema->listTables();
if (empty($tables)) {
if (!$tables) {
throw new RuntimeException('Your database does not have any tables.');
}
sort($tables);
Expand Down Expand Up @@ -97,7 +97,7 @@ public function listUnskipped(): array
protected function shouldSkip(string $table): bool
{
foreach ($this->ignore as $ignore) {
if (strpos($ignore, '/') === 0) {
if (str_starts_with($ignore, '/')) {
if ((bool)preg_match($ignore, $table)) {
return true;
}
Expand Down

0 comments on commit 58158c2

Please sign in to comment.