Files
stats/packages/db/code-migrations/helpers.ts
Carl-Gerhard Lindesvärd d7c6e88adc fix: change order keys for clickhouse tables
* wip

* rename

* fix: minor things before merging new order keys

* fix: add maintenance mode

* fix: update order by for session and events

* fix: remove properties from sessions and final migration test

* fix: set end date on migrations

* fix: comments
2025-12-16 12:48:51 +01:00

37 lines
848 B
TypeScript

export function printBoxMessage(title: string, lines: (string | unknown)[]) {
console.log('┌──┐');
console.log('│');
if (title) {
console.log(`${title}`);
if (lines.length) {
console.log('│');
}
}
lines.forEach((line) => {
console.log(`${line}`);
});
console.log('│');
console.log('└──┘');
}
export function getIsCluster() {
const args = process.argv;
return (
args.includes('--cluster') ||
process.env.CLICKHOUSE_CLUSTER === 'true' ||
process.env.CLICKHOUSE_CLUSTER === '1'
);
}
export function getIsSelfHosting() {
return process.env.SELF_HOSTED === 'true' || !!process.env.SELF_HOSTED;
}
export function getIsDry() {
return process.argv.includes('--dry');
}
export function getShouldIgnoreRecord() {
return process.argv.includes('--no-record');
}