Update migration script to check the unique index while inserting data into library_item table

This commit is contained in:
Hongbo Wu
2023-09-24 19:39:10 +08:00
parent e950662ced
commit 71c203cdb2

View File

@ -122,7 +122,7 @@ async def insert_library_items(db_conn, library_items, original_ids):
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,
$11, $12, $13, $14, $15, $16, $17, $18, $19,
$20, $21, $22, $23, $24, $25, $26, $27, $28, $29)
ON CONFLICT (user_id, original_url) DO UPDATE SET
ON CONFLICT (user_id, md5(original_url)) DO UPDATE SET
title = EXCLUDED.title,
author = EXCLUDED.author,
description = EXCLUDED.description,