Skip to content

Commit

Permalink
fix(kw-search) upsert_data_source_[table | node] should actually upse…
Browse files Browse the repository at this point in the history
…rt (#8974)

Co-authored-by: Henry Fontanier <[email protected]>
  • Loading branch information
fontanierh and Henry Fontanier authored Nov 27, 2024
1 parent f99dce2 commit be0566b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/src/stores/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,10 @@ impl Store for PostgresStore {
.prepare(
"INSERT INTO data_sources_folders \
(id, data_source, created, folder_id) \
VALUES (DEFAULT, $1, $2, $3) RETURNING id",
VALUES (DEFAULT, $1, $2, $3) \
ON CONFLICT (data_source, folder_id) DO UPDATE \
SET created = EXCLUDED.created \
RETURNING id",
)
.await?;

Expand Down Expand Up @@ -3033,7 +3036,11 @@ impl Store for PostgresStore {
.prepare(
"INSERT INTO data_sources_nodes \
(id, data_source, created, node_id, timestamp, title, mime_type, parents, document, \"table\", folder) \
VALUES (DEFAULT, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id",
VALUES (DEFAULT, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) \
ON CONFLICT (data_source, node_id) DO UPDATE \
SET created = EXCLUDED.created, timestamp = EXCLUDED.timestamp, title = EXCLUDED.title, \
mime_type = EXCLUDED.mime_type, parents = EXCLUDED.parents, document = EXCLUDED.document, \
\"table\" = EXCLUDED.\"table\", folder = EXCLUDED.folder RETURNING id",
)
.await?;

Expand Down

0 comments on commit be0566b

Please sign in to comment.