chore:little fixes and formating and linting and patches

This commit is contained in:
2026-03-31 15:50:54 +02:00
parent a1ce71ffb6
commit 9b197abcfa
815 changed files with 22960 additions and 8982 deletions

View File

@@ -1,10 +1,10 @@
import fs from 'node:fs';
import path from 'node:path';
import { dirname } from 'node:path';
import path, { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
import { formatClickhouseDate } from '../src/clickhouse/client';
import {
createDatabase,
@@ -27,7 +27,7 @@ export async function up() {
const hasEventsBots = existingTables.includes('events_bots_distributed');
const hasProfiles = existingTables.includes('profiles_distributed');
const hasProfileAliases = existingTables.includes(
'profile_aliases_distributed',
'profile_aliases_distributed'
);
const isSelfHosting = getIsSelfHosting();
@@ -50,8 +50,8 @@ export async function up() {
sqls.push(
...existingTables
.filter((table) => {
return (
!table.endsWith('_tmp') && !existingTables.includes(`${table}_tmp`)
return !(
table.endsWith('_tmp') || existingTables.includes(`${table}_tmp`)
);
})
.flatMap((table) => {
@@ -60,7 +60,7 @@ export async function up() {
to: `${table}_tmp`,
isClustered,
});
}),
})
);
}
@@ -263,7 +263,7 @@ export async function up() {
distributionHash: 'cityHash64(project_id, name)',
replicatedVersion,
isClustered,
}),
})
);
if (isSelfHostingPostCluster) {
@@ -321,7 +321,7 @@ export async function up() {
interval: 'week',
},
})
: []),
: [])
);
}
@@ -336,7 +336,7 @@ export async function up() {
interval: 'week',
},
})
: []),
: [])
);
}
@@ -348,9 +348,9 @@ export async function up() {
.trim()
.replace(/;$/, '')
.replace(/\n{2,}/g, '\n')
.concat(';'),
.concat(';')
)
.join('\n\n---\n\n'),
.join('\n\n---\n\n')
);
printBoxMessage('Will start migration for self-hosting setup.', [
@@ -369,9 +369,9 @@ export async function up() {
(table) =>
`docker compose exec -it op-ch clickhouse-client --query "${dropTable(
`openpanel.${table}_tmp`,
false,
)}"`,
),
false
)}"`
)
);
}
}