Skip to content

Commit

Permalink
Update according to main PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Apr 27, 2024
1 parent 125bb05 commit 0eefbee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ private function loadColumnSchema(array $info): ColumnSchemaInterface
$type = $this->getColumnType($dbType, $info);
$isUnsigned = str_contains($dbType, 'unsigned');
/** @psalm-var ColumnInfo $info */
$column = $this->createColumnSchema($type, $info['name'], unsigned: $isUnsigned);
$column = $this->createColumnSchema($type, unsigned: $isUnsigned);
$column->name($info['name']);
$column->size($info['size'] ?? null);
$column->precision($info['precision'] ?? null);
$column->scale($info['scale'] ?? null);
Expand Down
10 changes: 0 additions & 10 deletions tests/ColumnSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@

use PDO;
use Yiisoft\Db\Command\Param;
use Yiisoft\Db\Expression\JsonExpression;
use Yiisoft\Db\Schema\Column\BinaryColumnSchema;
use Yiisoft\Db\Schema\Column\BooleanColumnSchema;
use Yiisoft\Db\Schema\Column\DoubleColumnSchema;
use Yiisoft\Db\Schema\Column\IntegerColumnSchema;
use Yiisoft\Db\Schema\Column\JsonColumnSchema;
use Yiisoft\Db\Schema\Column\StringColumnSchema;
use Yiisoft\Db\Schema\SchemaInterface;
use Yiisoft\Db\Sqlite\Tests\Support\TestTrait;
use Yiisoft\Db\Query\Query;
use Yiisoft\Db\Tests\Common\CommonColumnSchemaTest;
Expand Down Expand Up @@ -80,14 +78,6 @@ public function testPhpTypeCast(): void
$db->close();
}

public function testTypeCastJson(): void
{
$columnSchema = new JsonColumnSchema('json_col');

$this->assertSame(['a' => 1], $columnSchema->phpTypecast('{"a":1}'));
$this->assertEquals(new JsonExpression(['a' => 1], SchemaInterface::TYPE_JSON), $columnSchema->dbTypecast(['a' => 1]));
}

public function testColumnSchemaInstance()
{
$db = $this->getConnection(true);
Expand Down

0 comments on commit 0eefbee

Please sign in to comment.