From 75d5e2b72dbcfac5360b3bc151da45bf0ea3b36b Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Mon, 18 May 2026 22:07:47 +0200 Subject: [PATCH] Revert "KI-AGENT: Exportiere Sachkonten beim Mandantenumzug" This reverts commit 30aaf141c71118835be0c74a26d37cf08c04809f. --- backend/src/utils/tenantFullExport.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/backend/src/utils/tenantFullExport.ts b/backend/src/utils/tenantFullExport.ts index 4d4a559..dc9584e 100644 --- a/backend/src/utils/tenantFullExport.ts +++ b/backend/src/utils/tenantFullExport.ts @@ -123,7 +123,6 @@ export const buildTenantFullExport = async (server: FastifyInstance, tenantId: n if (!tenantRows.length) throw new Error("Tenant nicht gefunden") addRows(tables, "tenants", tenantRows) - addRows(tables, "accounts", await loadRows(client, "accounts", `${quoteIdent("accountChart")} = $1`, [tenantRows[0].accountChart || "skr03"])) for (const [table, metadata] of columnsByTable.entries()) { if (table === "tenants") continue @@ -287,15 +286,8 @@ const insertRows = async (client: any, table: string, rows: Record[ const placeholders = rowColumns.map((_, index) => `$${index + 1}`).join(", ") const values = rowColumns.map((column) => prepareColumnValue(row[column], metadata.jsonColumns.has(column))) - const conflictSql = table === "tenants" && rowColumns.includes("id") - ? `on conflict (${quoteIdent("id")}) do update set ${rowColumns - .filter((column) => column !== "id") - .map((column) => `${quoteIdent(column)} = excluded.${quoteIdent(column)}`) - .join(", ")}` - : "on conflict do nothing" - await client.query( - `insert into ${quoteIdent(table)} (${rowColumns.map(quoteIdent).join(", ")}) values (${placeholders}) ${conflictSql}`, + `insert into ${quoteIdent(table)} (${rowColumns.map(quoteIdent).join(", ")}) values (${placeholders}) on conflict do nothing`, values ) inserted += 1 @@ -336,7 +328,6 @@ export const importTenantFullExport = async ( const client = await pool.connect() const importOrder = [ "tenants", - "accounts", "auth_users", "auth_roles", "auth_role_permissions",