From 051fbfcebdb59c3caf2043945c22c7e58d755665 Mon Sep 17 00:00:00 2001 From: Aiden Foxx Date: Sat, 12 Jun 2021 19:18:35 +0200 Subject: [PATCH] Fixed migrations for fresh Oracle install (#6228) --- .../database/migrations/20201105B-change-webhook-url-type.ts | 4 +++- .../migrations/20210312A-webhooks-collections-text.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/database/migrations/20201105B-change-webhook-url-type.ts b/api/src/database/migrations/20201105B-change-webhook-url-type.ts index d1ad118cc5..3107d4d9dd 100644 --- a/api/src/database/migrations/20201105B-change-webhook-url-type.ts +++ b/api/src/database/migrations/20201105B-change-webhook-url-type.ts @@ -1,4 +1,6 @@ import { Knex } from 'knex'; +// @ts-ignore +import Client_Oracledb from 'knex/lib/dialects/oracledb'; import env from '../../env'; async function oracleAlterUrl(knex: Knex, type: string): Promise { @@ -10,7 +12,7 @@ async function oracleAlterUrl(knex: Knex, type: string): Promise { } export async function up(knex: Knex): Promise { - if (env.DB_CLIENT === 'oracledb') { + if (knex.client instanceof Client_Oracledb) { await oracleAlterUrl(knex, 'CLOB'); return; } diff --git a/api/src/database/migrations/20210312A-webhooks-collections-text.ts b/api/src/database/migrations/20210312A-webhooks-collections-text.ts index 09cd50b5c1..489e0253f5 100644 --- a/api/src/database/migrations/20210312A-webhooks-collections-text.ts +++ b/api/src/database/migrations/20210312A-webhooks-collections-text.ts @@ -1,4 +1,6 @@ import { Knex } from 'knex'; +// @ts-ignore +import Client_Oracledb from 'knex/lib/dialects/oracledb'; import env from '../../env'; async function oracleAlterCollections(knex: Knex, type: string): Promise { @@ -10,7 +12,7 @@ async function oracleAlterCollections(knex: Knex, type: string): Promise { } export async function up(knex: Knex): Promise { - if (env.DB_CLIENT === 'oracledb') { + if (knex.client instanceof Client_Oracledb) { await oracleAlterCollections(knex, 'CLOB'); return; }