Compare commits

...

2 Commits

Author SHA1 Message Date
Félix Malfait 676866a554 Fix json type in clickhouse migrations (#11710)
Settings in clickhouse are only set for the duration of the session so
we need to keep the same client
2025-04-23 22:09:46 +02:00
Félix Malfait fc6aafd3c6 Fix clickhouse migration not in dist (#11709)
Clickhouse migrations were not correctly copied to the dist folder (for
command yarn clickhouse:migrate:prod)
2025-04-23 21:23:31 +02:00
2 changed files with 7 additions and 24 deletions
+4
View File
@@ -25,6 +25,10 @@
{
"include": "**/serverless/drivers/constants/executor/index.mjs",
"outDir": "dist/assets"
},
{
"include": "**/database/clickhouse/migrations/*.sql",
"outDir": "dist/src"
}
],
"watchAssets": true
@@ -30,30 +30,6 @@ async function ensureDatabaseExists() {
query: `CREATE DATABASE IF NOT EXISTS "${database}"`,
});
let jsonTypeEnabled = false;
try {
await client.command({
query: `SET enable_json_type = 1`,
});
jsonTypeEnabled = true;
} catch (error) {
// Intentionally empty - will try alternative method
}
try {
await client.command({
query: `SET allow_experimental_json_type = 1`,
});
jsonTypeEnabled = true;
} catch (error) {
// Intentionally empty - failure handled by jsonTypeEnabled check
}
if (!jsonTypeEnabled) {
console.error('Failed to enable JSON type');
}
await client.close();
}
@@ -99,6 +75,9 @@ async function runMigrations() {
const client = createClient({
url: clickhouseUrl(),
clickhouse_settings: {
allow_experimental_json_type: 1,
},
});
await ensureMigrationTable(client);