diff --git a/webapps/console/components/ConnectionEditorPage/ConnectionEditorPage.tsx b/webapps/console/components/ConnectionEditorPage/ConnectionEditorPage.tsx index d415cf4f5..5e77b8af6 100644 --- a/webapps/console/components/ConnectionEditorPage/ConnectionEditorPage.tsx +++ b/webapps/console/components/ConnectionEditorPage/ConnectionEditorPage.tsx @@ -364,7 +364,24 @@ function ConnectionEditor({ component: ( updateOptions({ dataLayout })} + onChange={dataLayout => { + if (existingLink) updateOptions({ dataLayout }); + else { + if (dataLayout === "jitsu-legacy") { + updateOptions({ + dataLayout, + primaryKey: "eventn_ctx_event_id", + timestampColumn: "_timestamp", + }); + } else { + updateOptions({ + dataLayout, + primaryKey: connectionOptionsZodType.parse({}).primaryKey || "message_id", + timestampColumn: "timestamp", + }); + } + } + }} value={connectionOptions.dataLayout || "segment-single-table"} /> ),