Skip to content

Commit

Permalink
Merge branch 'master' into fix-update-with-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Mar 13, 2024
2 parents 8fc6328 + 4f44e1a commit 8db2bea
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
- ubuntu-latest

php:
- 8.0
- 8.1

services:
Expand Down Expand Up @@ -82,6 +81,6 @@ jobs:

- name: Run infection.
run: |
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
vendor/bin/roave-infection-static-analysis-plugin --threads=2 --ignore-msi-with-no-mutations --only-covered
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Enh #312: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov)
- Bug #314: Fix `Command::insertWithReturningPks()` method for empty values (@Tigrov)
- Enh #319: Minor refactoring of `DDLQueryBuilder` and `Schema` (@Tigrov)
- Enh #318: Resolve deprecated methods (@Tigrov)

## 1.1.0 November 12, 2023

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"require-dev": {
"maglnet/composer-require-checker": "^4.2",
"phpunit/phpunit": "^9.5|^10.0",
"rector/rector": "^0.19",
"rector/rector": "^1.0",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30|^5.20",
Expand Down
9 changes: 6 additions & 3 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Yiisoft\Db\Schema\ColumnSchemaInterface;
use Yiisoft\Db\Schema\TableSchemaInterface;

use function array_change_key_case;
use function array_map;
use function array_merge;
use function array_values;
Expand Down Expand Up @@ -230,7 +231,7 @@ protected function findColumns(TableSchemaInterface $table): bool

/** @psalm-var ColumnInfoArray $info */
foreach ($columns as $info) {
$info = $this->normalizeRowKeyCase($info, false);
$info = array_change_key_case($info);

$info['extra_default_value'] = $columnsExtra[(string) $info['field']] ?? '';

Expand Down Expand Up @@ -409,6 +410,8 @@ protected function findViewNames(string $schema = ''): array
* @param string $name The table name.
*
* @return array The cache key.
*
* @psalm-suppress DeprecatedMethod
*/
protected function getCacheKey(string $name): array
{
Expand Down Expand Up @@ -675,7 +678,7 @@ private function loadTableConstraints(string $tableName, string $returnType): ar
])->queryAll();

/** @psalm-var array[][] $constraints */
$constraints = $this->normalizeRowKeyCase($constraints, true);
$constraints = array_map('array_change_key_case', $constraints);
$constraints = DbArrayHelper::index($constraints, null, ['type', 'name']);

$result = [
Expand Down Expand Up @@ -790,7 +793,7 @@ protected function loadTableIndexes(string $tableName): array
])->queryAll();

/** @psalm-var array[] $indexes */
$indexes = $this->normalizeRowKeyCase($indexes, true);
$indexes = array_map('array_change_key_case', $indexes);
$indexes = DbArrayHelper::index($indexes, null, ['name']);
$result = [];

Expand Down
2 changes: 1 addition & 1 deletion tests/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public function testNotConnectionPDO(): void
$this->expectException(NotSupportedException::class);
$this->expectExceptionMessage('Only PDO connections are supported.');

$schema->refreshTableSchema('customer');
$schema->refresh();
}

public function testInsertDefaultValues()
Expand Down

0 comments on commit 8db2bea

Please sign in to comment.