From 1c99beb2c6a693045e73e39527909be3a24f9213 Mon Sep 17 00:00:00 2001 From: Mia Date: Thu, 3 Jul 2025 19:01:07 +0100 Subject: [PATCH] fix(consumer): would help to insert into the right columns --- consumer/src/db/copy.rs | 2 +- consumer/src/db/record.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/consumer/src/db/copy.rs b/consumer/src/db/copy.rs index 1bf09950..0ad91e45 100644 --- a/consumer/src/db/copy.rs +++ b/consumer/src/db/copy.rs @@ -382,7 +382,7 @@ pub async fn copy_records( .await?; let writer = conn - .copy_in("COPY records_tmp (at_uri, cid, did) FROM STDIN (FORMAT binary)") + .copy_in("COPY records_tmp (at_uri, did, cid) FROM STDIN (FORMAT binary)") .await?; let writer = BinaryCopyInWriter::new(writer, &[Type::TEXT, Type::TEXT, Type::TEXT]); diff --git a/consumer/src/db/record.rs b/consumer/src/db/record.rs index a00ee205..137366bf 100644 --- a/consumer/src/db/record.rs +++ b/consumer/src/db/record.rs @@ -13,7 +13,7 @@ pub async fn record_upsert( ) -> PgExecResult { conn.execute( "INSERT INTO records (at_uri, did, cid) VALUES ($1, $2, $3) ON CONFLICT (at_uri) DO UPDATE SET cid=EXCLUDED.cid", - &[&repo, &at_uri, &cid.to_string()], + &[&at_uri, &repo, &cid.to_string()], ).await } -- 2.51.2