From fb615ed201fc2b2002da6f7c972f66f2d776c8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Tue, 13 May 2025 15:36:55 +0200 Subject: [PATCH] Remove clickhouse check requiring elevated permissions (#12006) This check was un-necessary, it will fail after in anycase. Let's leave it to the user to create the DB --- .../clickHouse/migrations/run-migrations.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/twenty-server/src/database/clickHouse/migrations/run-migrations.ts b/packages/twenty-server/src/database/clickHouse/migrations/run-migrations.ts index a6f918613..c57b48b2f 100644 --- a/packages/twenty-server/src/database/clickHouse/migrations/run-migrations.ts +++ b/packages/twenty-server/src/database/clickHouse/migrations/run-migrations.ts @@ -20,19 +20,6 @@ const clickHouseUrl = () => { ); }; -async function ensureDatabaseExists() { - const [url, database] = clickHouseUrl().split(/\/(?=[^/]*$)/); - const client = createClient({ - url, - }); - - await client.command({ - query: `CREATE DATABASE IF NOT EXISTS "${database}"`, - }); - - await client.close(); -} - async function ensureMigrationTable(client: ClickHouseClient) { await client.command({ query: ` @@ -71,8 +58,6 @@ async function runMigrations() { const dir = path.join(__dirname); const files = fs.readdirSync(dir).filter((f) => f.endsWith('.sql')); - await ensureDatabaseExists(); - const client = createClient({ url: clickHouseUrl(), clickhouse_settings: {