From 89da7a363ad77d37212f21461b98c01b112e9f06 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 17:27:20 +0700 Subject: [PATCH 01/11] Update according changes in `ColumnSchemaInterface` --- src/DMLQueryBuilder.php | 4 +- src/Schema.php | 6 +-- tests/CommandTest.php | 2 +- tests/Provider/SchemaProvider.php | 80 +++++++++++++------------------ tests/QueryBuilderTest.php | 6 +-- 5 files changed, 40 insertions(+), 58 deletions(-) diff --git a/src/DMLQueryBuilder.php b/src/DMLQueryBuilder.php index 732a3506..c8ee2e37 100644 --- a/src/DMLQueryBuilder.php +++ b/src/DMLQueryBuilder.php @@ -49,11 +49,11 @@ public function insertWithReturningPks(string $table, QueryInterface|array $colu if (in_array($dbType, ['char', 'varchar', 'nchar', 'nvarchar', 'binary', 'varbinary'], true)) { $dbType .= '(MAX)'; } elseif ($dbType === 'timestamp') { - $dbType = $returnColumn->isAllowNull() ? 'varbinary(8)' : 'binary(8)'; + $dbType = $returnColumn->isNotNull() ? 'binary(8)' : 'varbinary(8)'; } $quotedName = $this->quoter->quoteColumnName($columnName); - $createdCols[] = $quotedName . ' ' . (string) $dbType . ' ' . ($returnColumn->isAllowNull() ? 'NULL' : ''); + $createdCols[] = $quotedName . ' ' . (string) $dbType . ' ' . ($returnColumn->isNotNull() ? '' : 'NULL'); $insertedCols[] = 'INSERTED.' . $quotedName; } diff --git a/src/Schema.php b/src/Schema.php index fadea8bc..46ca44b2 100644 --- a/src/Schema.php +++ b/src/Schema.php @@ -39,7 +39,6 @@ * is_computed: string, * comment: null|string, * size?: int, - * precision?: int, * scale?: int, * } * @psalm-type ConstraintArray = array< @@ -364,11 +363,10 @@ private function loadColumnSchema(array $info): ColumnSchemaInterface $dbType = $info['data_type']; /** @psalm-var ColumnArray $info */ $column = $columnFactory->fromDefinition($dbType); + /** @psalm-suppress DeprecatedMethod */ $column->name($info['column_name']); - $column->allowNull($info['is_nullable'] === 'YES'); + $column->notNull($info['is_nullable'] !== 'YES'); $column->dbType($dbType); - $column->enumValues([]); // MSSQL has only vague equivalents to enum. - $column->primaryKey(false); // The primary key will be determined in the `findColumns()` method. $column->autoIncrement($info['is_identity'] === '1'); $column->computed($info['is_computed'] === '1'); $column->comment($info['comment'] ?? ''); diff --git a/tests/CommandTest.php b/tests/CommandTest.php index 13a2d037..607c632d 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -341,7 +341,7 @@ public function testAlterColumnWithDefaultNull() $fieldCol = $db->getTableSchema('column_with_constraint', true)->getColumn('field'); - $this->assertFalse($fieldCol->isAllowNull()); + $this->assertTrue($fieldCol->isNotNull()); $this->assertNull($fieldCol->getDefaultValue()); $this->assertSame('nvarchar(40)', $fieldCol->getDbType()); diff --git a/tests/Provider/SchemaProvider.php b/tests/Provider/SchemaProvider.php index cf38b620..d53db017 100644 --- a/tests/Provider/SchemaProvider.php +++ b/tests/Provider/SchemaProvider.php @@ -19,11 +19,10 @@ public static function columns(): array 'dbType' => 'int', 'phpType' => 'int', 'primaryKey' => false, - 'allowNull' => false, + 'notNull' => true, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => null, ], @@ -32,11 +31,10 @@ public static function columns(): array 'dbType' => 'int', 'phpType' => 'int', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => 1, ], @@ -45,11 +43,10 @@ public static function columns(): array 'dbType' => 'tinyint', 'phpType' => 'int', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => 1, ], @@ -58,11 +55,10 @@ public static function columns(): array 'dbType' => 'smallint', 'phpType' => 'int', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => 1, ], @@ -71,11 +67,10 @@ public static function columns(): array 'dbType' => 'char(100)', 'phpType' => 'string', 'primaryKey' => false, - 'allowNull' => false, + 'notNull' => true, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => 100, - 'precision' => 100, 'scale' => null, 'defaultValue' => null, ], @@ -84,11 +79,10 @@ public static function columns(): array 'dbType' => 'varchar(100)', 'phpType' => 'string', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => 100, - 'precision' => 100, 'scale' => null, 'defaultValue' => 'something', ], @@ -97,11 +91,10 @@ public static function columns(): array 'dbType' => 'text', 'phpType' => 'string', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => null, ], @@ -110,11 +103,10 @@ public static function columns(): array 'dbType' => 'decimal(4,3)', 'phpType' => 'float', 'primaryKey' => false, - 'allowNull' => false, + 'notNull' => true, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => 4, - 'precision' => 4, 'scale' => 3, 'defaultValue' => null, ], @@ -123,11 +115,10 @@ public static function columns(): array 'dbType' => 'float', 'phpType' => 'float', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => 1.23, ], @@ -136,11 +127,10 @@ public static function columns(): array 'dbType' => 'varbinary', 'phpType' => 'mixed', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => null, ], @@ -149,11 +139,10 @@ public static function columns(): array 'dbType' => 'decimal(5,2)', 'phpType' => 'float', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => 5, - 'precision' => 5, 'scale' => 2, 'defaultValue' => 33.22, ], @@ -162,11 +151,10 @@ public static function columns(): array 'dbType' => 'datetime', 'phpType' => 'string', 'primaryKey' => false, - 'allowNull' => false, + 'notNull' => true, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => '2002-01-01 00:00:00', ], @@ -175,11 +163,10 @@ public static function columns(): array 'dbType' => 'bit', 'phpType' => 'bool', 'primaryKey' => false, - 'allowNull' => false, + 'notNull' => true, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => null, ], @@ -188,11 +175,10 @@ public static function columns(): array 'dbType' => 'bit', 'phpType' => 'bool', 'primaryKey' => false, - 'allowNull' => true, + 'notNull' => false, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => true, ], @@ -206,11 +192,10 @@ public static function columns(): array 'dbType' => 'int', 'phpType' => 'int', 'primaryKey' => true, - 'allowNull' => false, + 'notNull' => true, 'autoIncrement' => true, - 'enumValues' => [], + 'enumValues' => null, 'size' => null, - 'precision' => null, 'scale' => null, 'defaultValue' => null, ], @@ -219,11 +204,10 @@ public static function columns(): array 'dbType' => 'varchar(255)', 'phpType' => 'string', 'primaryKey' => false, - 'allowNull' => false, + 'notNull' => true, 'autoIncrement' => false, - 'enumValues' => [], + 'enumValues' => null, 'size' => 255, - 'precision' => 255, 'scale' => null, 'defaultValue' => null, ], diff --git a/tests/QueryBuilderTest.php b/tests/QueryBuilderTest.php index ea8e9f97..3015dc32 100644 --- a/tests/QueryBuilderTest.php +++ b/tests/QueryBuilderTest.php @@ -847,7 +847,7 @@ public function testAlterColumnOnDb(): void $schema = $db->getTableSchema('[foo1]', true); $this->assertSame('varchar(255)', $schema?->getColumn('bar')->getDbType()); - $this->assertSame(true, $schema?->getColumn('bar')->isAllowNull()); + $this->assertFalse($schema?->getColumn('bar')->isNotNull()); $sql = $db->getQueryBuilder()->alterColumn( 'foo1', @@ -858,7 +858,7 @@ public function testAlterColumnOnDb(): void $schema = $db->getTableSchema('[foo1]', true); $this->assertSame('nvarchar(128)', $schema?->getColumn('bar')->getDbType()); - $this->assertSame(false, $schema?->getColumn('bar')->isAllowNull()); + $this->assertTrue($schema?->getColumn('bar')->isNotNull()); $sql = $db->getQueryBuilder()->alterColumn( 'foo1', @@ -888,7 +888,7 @@ public function testAlterColumnWithCheckConstraintOnDb(): void $db->createCommand($sql)->execute(); $schema = $db->getTableSchema('[foo1]', true); $this->assertEquals('nvarchar(128)', $schema?->getColumn('bar')->getDbType()); - $this->assertEquals(true, $schema?->getColumn('bar')->isAllowNull()); + $this->assertFalse($schema?->getColumn('bar')->isNotNull()); $sql = "INSERT INTO [foo1]([bar]) values('abcdef')"; $this->assertEquals(1, $db->createCommand($sql)->execute()); From 46453852dcab6bf9ff23fb10cb59ff88bfa8b8b6 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 18:10:10 +0700 Subject: [PATCH 02/11] Fix tests --- .github/workflows/build.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1de761f..396a596a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ name: build jobs: tests: - name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql.server }} + name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }} env: COMPOSER_ROOT_VERSION: 1.0.0 @@ -35,37 +35,31 @@ jobs: - 8.2 - 8.3 - mssql: - - server: 2022-latest - odbc-version: 18 - flag: "-C" + mssql: 2022-latest include: - php: 8.3 - mssql: { server: 2017-latest } + mssql: 2017-latest - php: 8.3 - mssql: - server: 2019-latest - odbc-version: 18 - flag: "-C" + mssql: 2019-latest services: mssql: - image: mcr.microsoft.com/mssql/server:${{ matrix.mssql.server }} + image: mcr.microsoft.com/mssql/server:${{ matrix.mssql }} env: SA_PASSWORD: YourStrong!Passw0rd ACCEPT_EULA: Y MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql /opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From 6d5f993d294cb9b9268e2d9c09c2da7e90e4fc66 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 18:12:20 +0700 Subject: [PATCH 03/11] Fix tests --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 396a596a..dd17f63d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,8 @@ jobs: - 8.2 - 8.3 - mssql: 2022-latest + mssql: + - 2022-latest include: - php: 8.3 From 393384ff3a72110bbd157748a8ee9e996cb1a0a8 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 19:02:52 +0700 Subject: [PATCH 04/11] Fix tests --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd17f63d..0e98d3c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,14 +53,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -No -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -No -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From ba152377156d6900978ad3bfd4dcb7f51e8d5f9f Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 19:44:44 +0700 Subject: [PATCH 05/11] Fix tests --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e98d3c8..662f3635 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,14 +53,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -No -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -No -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From 08ca3e19505996b055063f063248a326bbf8145a Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 20:06:50 +0700 Subject: [PATCH 06/11] Fix tests --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 662f3635..e15bd12d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,14 +53,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From f4c9dabfe2a9b6e3595961ff366b43fb003f979d Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 20:13:28 +0700 Subject: [PATCH 07/11] Fix tests --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e15bd12d..cc6ffb1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,14 +53,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=20s --health-timeout=10s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From 864480b4a9bc63e9fc18c7881d8e046dfb1b2b58 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 20:42:19 +0700 Subject: [PATCH 08/11] Fix tests --- .github/workflows/build.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc6ffb1e..66adb433 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,13 +20,13 @@ name: build jobs: tests: - name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }} + name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql.server }} env: COMPOSER_ROOT_VERSION: 1.0.0 EXTENSIONS: pdo, pdo_sqlsrv-5.10.1 - runs-on: ubuntu-latest + runs-on: ${{ matrix.mssql.os || 'ubuntu-latest' }} strategy: matrix: @@ -36,31 +36,38 @@ jobs: - 8.3 mssql: - - 2022-latest + - server: 2022-latest + odbc-version: 18 + flag: "-C" include: - php: 8.3 - mssql: 2017-latest + mssql: + server: 2017-latest + os: ubuntu-20.04 - php: 8.3 - mssql: 2019-latest + mssql: + server: 2019-latest + odbc-version: 18 + flag: "-C" services: mssql: - image: mcr.microsoft.com/mssql/server:${{ matrix.mssql }} + image: mcr.microsoft.com/mssql/server:${{ matrix.mssql.server }} env: SA_PASSWORD: YourStrong!Passw0rd ACCEPT_EULA: Y MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=20s --health-timeout=10s --health-retries=3 + options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql /opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From 9102915b93719ec2b15cec831a04d6ea56467054 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 20:47:26 +0700 Subject: [PATCH 09/11] Fix tests --- .github/workflows/build.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66adb433..e5c2d8a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,8 +37,6 @@ jobs: mssql: - server: 2022-latest - odbc-version: 18 - flag: "-C" include: - php: 8.3 @@ -48,8 +46,6 @@ jobs: - php: 8.3 mssql: server: 2019-latest - odbc-version: 18 - flag: "-C" services: mssql: @@ -60,14 +56,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql /opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From 1502b7b98cceb1afca7d7d0f6057033aed09e994 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Fri, 20 Sep 2024 20:49:52 +0700 Subject: [PATCH 10/11] Fix tests --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5c2d8a6..66adb433 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,8 @@ jobs: mssql: - server: 2022-latest + odbc-version: 18 + flag: "-C" include: - php: 8.3 @@ -46,6 +48,8 @@ jobs: - php: 8.3 mssql: server: 2019-latest + odbc-version: 18 + flag: "-C" services: mssql: @@ -56,14 +60,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 + options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - name: Create MS SQL Database. - run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' + run: docker exec -i mssql /opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 From f861ff46894b056b109cd8506033bc4bccda80ad Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sat, 21 Sep 2024 08:47:09 +0700 Subject: [PATCH 11/11] Add line to CHANGELOG.md [skip ci] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c8f4ab..3ab08350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Enh #316: Implement `ColumnFactory` class (@Tigrov) - Enh #319: Separate column type constants (@Tigrov) - Enh #320: Realize `ColumnBuilder` class (@Tigrov) +- Enh #321: Update according changes in `ColumnSchemaInterface` (@Tigrov) ## 1.2.0 March 21, 2024