Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- Chg #343: Remove `yiisoft/json` dependency (@Tigrov)
- Enh #345: Refactor according changes in `db` package (@Tigrov)
- New #344: Add `caseSensitive` option to like condition (@vjik)
- Enh #347: Remove `getCacheKey()` and `getCacheTag()` methods from `Schema` class (@Tigrov)

## 1.2.0 March 21, 2024

Expand Down
1 change: 0 additions & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Yiisoft\Db\Schema\Quoter;
use Yiisoft\Db\Schema\QuoterInterface;
use Yiisoft\Db\Schema\SchemaInterface;

use Yiisoft\Db\Sqlite\Column\ColumnFactory;

use function str_starts_with;
Expand Down
26 changes: 0 additions & 26 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
use function array_column;
use function array_map;
use function count;
use function md5;
use function serialize;
use function strncasecmp;

/**
Expand Down Expand Up @@ -618,30 +616,6 @@ protected function findViewNames(string $schema = ''): array
return $views;
}

/**
* Returns the cache key for the specified table name.
*
* @param string $name the table name.
*
* @return array The cache key.
*/
protected function getCacheKey(string $name): array
{
return [self::class, ...$this->generateCacheKey(), $this->db->getQuoter()->getRawTableName($name)];
}

/**
* Returns the cache tag name.
*
* This allows {@see refresh()} to invalidate all cached table schemas.
*
* @return string The cache tag name.
*/
protected function getCacheTag(): string
{
return md5(serialize([self::class, ...$this->generateCacheKey()]));
}

/**
* @throws Throwable
*/
Expand Down
8 changes: 4 additions & 4 deletions tests/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ public function testBuildWithQuery(): void
$db = $this->getConnection();

$qb = $db->getQueryBuilder();
$with1Query = (new query($db))->select('id')->from('t1')->where('expr = 1');
$with2Query = (new query($db))->select('id')->from('t2')->innerJoin('a1', 't2.id = a1.id')->where('expr = 2');
$with3Query = (new query($db))->select('id')->from('t3')->where('expr = 3');
$query = (new query($db))
$with1Query = (new Query($db))->select('id')->from('t1')->where('expr = 1');
$with2Query = (new Query($db))->select('id')->from('t2')->innerJoin('a1', 't2.id = a1.id')->where('expr = 2');
$with3Query = (new Query($db))->select('id')->from('t3')->where('expr = 3');
$query = (new Query($db))
->withQuery($with1Query, 'a1')
->withQuery($with2Query->union($with3Query), 'a2')
->from('a2');
Expand Down