From 7d4c89eb6b90619250e9a079ba787769670fa06e Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Fri, 5 May 2023 14:30:52 +0200 Subject: [PATCH 1/2] refactor: Add deprecation notice for MySQL and MariaDB --- 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 c8292b5408d83..aa86e4d1bfded 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( + 'MySQL/MariaDB has been deprecated and will have support removed when n8n 1.0 is released. 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 e570109f11240..1a9413167f63e 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', From b7c35711efaa00028973709adf31a0c76ba52a39 Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Fri, 5 May 2023 16:46:53 +0200 Subject: [PATCH 2/2] Update packages/cli/src/commands/BaseCommand.ts Co-authored-by: Cornelius Suermann --- packages/cli/src/commands/BaseCommand.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/commands/BaseCommand.ts b/packages/cli/src/commands/BaseCommand.ts index aa86e4d1bfded..3ed08cfb3741a 100644 --- a/packages/cli/src/commands/BaseCommand.ts +++ b/packages/cli/src/commands/BaseCommand.ts @@ -59,7 +59,7 @@ export abstract class BaseCommand extends Command { if (['mysqldb', 'mariadb'].includes(dbType)) { LoggerProxy.warn( - 'MySQL/MariaDB has been deprecated and will have support removed when n8n 1.0 is released. Please migrate to PostgreSQL.', + 'Support for MySQL/MariaDB has been deprecated and will be removed with an upcoming version of n8n. Please migrate to PostgreSQL.', ); }