Skip to content

Commit 4520543

Browse files
committed
fix: Fix test/functional/schema-builder/change-column.ts to work with PostgresDriver
1 parent cf36054 commit 4520543

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

test/functional/schema-builder/change-column.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import {AuroraDataApiDriver} from "../../../src/driver/aurora-data-api/AuroraDat
66
// import {CockroachDriver} from "../../../src/driver/cockroachdb/CockroachDriver.ts";
77
import {MysqlDriver} from "../../../src/driver/mysql/MysqlDriver.ts";
88
import {OracleDriver} from "../../../src/driver/oracle/OracleDriver.ts";
9-
// TODO(uki00a) uncomment this when PostgresDriver is implemented.
10-
// import {PostgresDriver} from "../../../src/driver/postgres/PostgresDriver.ts";
9+
import {PostgresDriver} from "../../../src/driver/postgres/PostgresDriver.ts";
1110
import {SapDriver} from "../../../src/driver/sap/SapDriver.ts";
1211
import {AbstractSqliteDriver} from "../../../src/driver/sqlite-abstract/AbstractSqliteDriver.ts";
1312
import {SqlServerDriver} from "../../../src/driver/sqlserver/SqlServerDriver.ts";
@@ -169,7 +168,7 @@ describe("schema builder > change column", () => {
169168

170169
const queryRunner = connection.createQueryRunner();
171170

172-
if (false/*connection.driver instanceof PostgresDriver*/) // TODO(uki00a) uncomment this when PostgresDriver is implemented.
171+
if (connection.driver instanceof PostgresDriver)
173172
await queryRunner.query(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`);
174173

175174
const postMetadata = connection.getMetadata(Post);
@@ -178,9 +177,7 @@ describe("schema builder > change column", () => {
178177
idColumn.generationStrategy = "uuid";
179178

180179
// depending on driver, we must change column and referenced column types
181-
if (false/*connection.driver instanceof PostgresDriver || connection.driver instanceof CockroachDriver*/) {
182-
// TODO(uki00a) uncomment this when PostgresDriver is implemented.
183-
// TODO(uki00a) uncomment this when CockroachDriver is implemented.
180+
if (connection.driver instanceof PostgresDriver/* || connection.driver instanceof CockroachDriver*/) { // TODO(uki00a) uncomment this when CockroachDriver is implemented.
184181
idColumn.type = "uuid";
185182
} else if (connection.driver instanceof SqlServerDriver) {
186183
idColumn.type = "uniqueidentifier";
@@ -193,9 +190,7 @@ describe("schema builder > change column", () => {
193190
const postTable = await queryRunner.getTable("post");
194191
await queryRunner.release();
195192

196-
if (/*connection.driver instanceof PostgresDriver || */connection.driver instanceof SqlServerDriver/* || connection.driver instanceof CockroachDriver*/) {
197-
// TODO(uki00a) uncomment this when PostgresDriver is implemented.
198-
// TODO(uki00a) uncomment this when CockroachDriver is implemented.
193+
if (connection.driver instanceof PostgresDriver || connection.driver instanceof SqlServerDriver/* || connection.driver instanceof CockroachDriver*/) { // TODO(uki00a) uncomment this when CockroachDriver is implemented.
199194
postTable!.findColumnByName("id")!.isGenerated.should.be.true;
200195
postTable!.findColumnByName("id")!.generationStrategy!.should.be.equal("uuid");
201196

@@ -226,9 +221,7 @@ describe("schema builder > change column", () => {
226221
idColumn.generationStrategy = "uuid";
227222

228223
// depending on driver, we must change column and referenced column types
229-
if (false/*connection.driver instanceof PostgresDriver || connection.driver instanceof CockroachDriver*/) {
230-
// TODO(uki00a) uncomment this when PostgresDriver is implemented.
231-
// TODO(uki00a) uncomment this when CockroachDriver is implemented.
224+
if (connection.driver instanceof PostgresDriver/* || connection.driver instanceof CockroachDriver*/) { // TODO(uki00a) uncomment this when CockroachDriver is implemented.
232225
idColumn.type = "uuid";
233226
teacherColumn.type = "uuid";
234227
} else if (connection.driver instanceof SqlServerDriver) {
@@ -245,7 +238,7 @@ describe("schema builder > change column", () => {
245238
const teacherTable = await queryRunner.getTable("teacher");
246239
await queryRunner.release();
247240

248-
if (/*connection.driver instanceof PostgresDriver || */connection.driver instanceof SqlServerDriver) { // TODO(uki00a) uncomment this when PostgresDriver is implemented.
241+
if (connection.driver instanceof PostgresDriver || connection.driver instanceof SqlServerDriver) {
249242
teacherTable!.findColumnByName("id")!.isGenerated.should.be.true;
250243
teacherTable!.findColumnByName("id")!.generationStrategy!.should.be.equal("uuid");
251244

0 commit comments

Comments
 (0)