feat: dashboard v2, esm, upgrades (#211)
* esm * wip * wip * wip * wip * wip * wip * subscription notice * wip * wip * wip * fix envs * fix: update docker build * fix * esm/types * delete dashboard :D * add patches to dockerfiles * update packages + catalogs + ts * wip * remove native libs * ts * improvements * fix redirects and fetching session * try fix favicon * fixes * fix * order and resize reportds within a dashboard * improvements * wip * added userjot to dashboard * fix * add op * wip * different cache key * improve date picker * fix table * event details loading * redo onboarding completely * fix login * fix * fix * extend session, billing and improve bars * fix * reduce price on 10M
This commit is contained in:
committed by
GitHub
parent
436e81ecc9
commit
81a7e5d62e
@@ -2,7 +2,7 @@ import { logger } from '@/utils/logger';
|
||||
import { TABLE_NAMES, ch, db } from '@openpanel/db';
|
||||
import type { CronQueuePayload } from '@openpanel/queue';
|
||||
import type { Job } from 'bullmq';
|
||||
import { escape } from 'sqlstring';
|
||||
import sqlstring from 'sqlstring';
|
||||
|
||||
export async function deleteProjects(job: Job<CronQueuePayload>) {
|
||||
const projects = await db.project.findMany({
|
||||
@@ -33,7 +33,7 @@ export async function deleteProjects(job: Job<CronQueuePayload>) {
|
||||
job.log(`Delete project: "${project.id}"`);
|
||||
});
|
||||
|
||||
const where = `project_id IN (${projects.map((project) => escape(project.id)).join(',')})`;
|
||||
const where = `project_id IN (${projects.map((project) => sqlstring.escape(project.id)).join(',')})`;
|
||||
const tables = [
|
||||
TABLE_NAMES.events,
|
||||
TABLE_NAMES.profiles,
|
||||
@@ -47,7 +47,7 @@ export async function deleteProjects(job: Job<CronQueuePayload>) {
|
||||
|
||||
for (const table of tables) {
|
||||
const query =
|
||||
process.env.NEXT_PUBLIC_SELF_HOSTED === 'true'
|
||||
process.env.VITE_SELF_HOSTED === 'true'
|
||||
? `ALTER TABLE ${table} DELETE WHERE ${where};`
|
||||
: `ALTER TABLE ${table}_replicated ON CLUSTER '{cluster}' DELETE WHERE ${where};`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user