fix: option to allow cluster migrations without relying on self hosting env

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-10-23 10:49:45 +02:00
parent 411021ee04
commit bcfb4f25fb
3 changed files with 19 additions and 9 deletions

View File

@@ -16,7 +16,7 @@ import {
renameTable,
runClickhouseMigrationCommands,
} from '../src/clickhouse/migration';
import { getIsSelfHosting, printBoxMessage } from './helpers';
import { getIsCluster, getIsSelfHosting, printBoxMessage } from './helpers';
export async function up() {
const replicatedVersion = '1';
@@ -31,7 +31,7 @@ export async function up() {
);
const isSelfHosting = getIsSelfHosting();
const isClustered = !isSelfHosting;
const isClustered = getIsCluster();
const isSelfHostingPostCluster =
existingTables.includes('events_replicated') && isSelfHosting;
@@ -58,7 +58,7 @@ export async function up() {
return renameTable({
from: table,
to: `${table}_tmp`,
isClustered: false,
isClustered,
});
}),
);