From 0673a39fa016feaca4c206c0742f6bf1cbfa754f Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Mon, 8 May 2023 12:16:20 +0200 Subject: [PATCH] refactor: Add deprecation notice for MySQL and MariaDB (#6189) * refactor: Add deprecation notice for MySQL and MariaDB * Update packages/cli/src/commands/BaseCommand.ts Co-authored-by: Cornelius Suermann --------- Co-authored-by: Cornelius Suermann --- packages/cli/src/commands/BaseCommand.ts | 8 ++++++++ packages/cli/src/config/schema.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/BaseCommand.ts b/packages/cli/src/commands/BaseCommand.ts index c8292b5408..3ed08cfb37 100644 --- a/packages/cli/src/commands/BaseCommand.ts +++ b/packages/cli/src/commands/BaseCommand.ts @@ -55,6 +55,14 @@ export abstract class BaseCommand extends Command { this.exitWithCrash('There was an error initializing DB', error), ); + const dbType = config.getEnv('database.type'); + + if (['mysqldb', 'mariadb'].includes(dbType)) { + LoggerProxy.warn( + 'Support for MySQL/MariaDB has been deprecated and will be removed with an upcoming version of n8n. Please migrate to PostgreSQL.', + ); + } + this.instanceId = this.userSettings.instanceId ?? ''; await Container.get(PostHogClient).init(this.instanceId); await Container.get(InternalHooks).init(this.instanceId); diff --git a/packages/cli/src/config/schema.ts b/packages/cli/src/config/schema.ts index e570109f11..1a9413167f 100644 --- a/packages/cli/src/config/schema.ts +++ b/packages/cli/src/config/schema.ts @@ -129,7 +129,7 @@ export const schema = { }, mysqldb: { database: { - doc: 'MySQL Database', + doc: '[DEPRECATED] MySQL Database', format: String, default: 'n8n', env: 'DB_MYSQLDB_DATABASE',