@@ -5,6 +5,9 @@ import {AbstractSqliteDriver} from "../../../src/driver/sqlite-abstract/Abstract
55import { closeTestingConnections , createTestingConnections , reloadTestingDatabases } from "../../utils/test-utils" ;
66import { Post } from "./entity/Post" ;
77import { PostVersion } from "./entity/PostVersion" ;
8+ import { PostgresDriver } from "../../../src/driver/postgres/PostgresDriver" ;
9+ import { CockroachDriver } from "../../../src/driver/cockroachdb/CockroachDriver" ;
10+ import { SqlServerDriver } from "../../../src/driver/sqlserver/SqlServerDriver" ;
811
912describe ( "schema builder > change column" , ( ) => {
1013
@@ -180,7 +183,7 @@ describe("schema builder > change column", () => {
180183 idColumn . generationStrategy = "uuid" ;
181184
182185 // depending on driver, we must change column and referenced column types
183- if ( connection . driver . options . type === "postgres" || connection . driver . options . type === "cockroachdb" ) {
186+ if ( connection . driver instanceof PostgresDriver || connection . driver instanceof CockroachDriver ) {
184187 idColumn . type = "uuid" ;
185188 } else if ( connection . driver . options . type === "mssql" ) {
186189 idColumn . type = "uniqueidentifier" ;
@@ -193,7 +196,7 @@ describe("schema builder > change column", () => {
193196 const postTable = await queryRunner . getTable ( "post" ) ;
194197 await queryRunner . release ( ) ;
195198
196- if ( connection . driver . options . type === "postgres" || connection . driver . options . type === "mssql" || connection . driver . options . type === "cockroachdb" ) {
199+ if ( connection . driver instanceof PostgresDriver || connection . driver instanceof CockroachDriver || connection . driver instanceof SqlServerDriver ) {
197200 postTable ! . findColumnByName ( "id" ) ! . isGenerated . should . be . true ;
198201 postTable ! . findColumnByName ( "id" ) ! . generationStrategy ! . should . be . equal ( "uuid" ) ;
199202
@@ -224,7 +227,7 @@ describe("schema builder > change column", () => {
224227 idColumn . generationStrategy = "uuid" ;
225228
226229 // depending on driver, we must change column and referenced column types
227- if ( connection . driver . options . type === "postgres" || connection . driver . options . type === "cockroachdb" ) {
230+ if ( connection . driver instanceof PostgresDriver || connection . driver instanceof CockroachDriver ) {
228231 idColumn . type = "uuid" ;
229232 teacherColumn . type = "uuid" ;
230233 } else if ( connection . driver . options . type === "mssql" ) {
0 commit comments