UNIQUE constraint failed: feeds_last_items.url #32

Closed
opened 2022-07-09 20:02:40 +00:00 by skobkin · 0 comments
Collaborator

When updating last feed items in the database, SQL query can fail sometimes because current database schema is relying on url of the FeedItem to be unique, but it's not the oftenly.

We should rely on something like guid and store it instead. We also probably don't need an UNIQUE constraint there at all.

This could be fixed while working on #15.

Traceback (most recent call last):
  File "update.py", line 18, in <module>
    updater.update()
  File "update_manager.py", line 30, in update
    self.database.update_feed_items(feed_id, new_items)
  File "database.py", line 137, in update_feed_items
    self.cur.executemany(
sqlite3.IntegrityError: UNIQUE constraint failed: feeds_last_items.url

Process finished with exit code 1
When updating last feed items in the database, SQL query can fail sometimes because current database schema is relying on `url` of the `FeedItem` to be unique, but it's not the oftenly. We should rely on something like `guid` and store it instead. We also probably don't need an `UNIQUE` constraint there **at all**. This could be fixed while working on #15. ``` Traceback (most recent call last): File "update.py", line 18, in <module> updater.update() File "update_manager.py", line 30, in update self.database.update_feed_items(feed_id, new_items) File "database.py", line 137, in update_feed_items self.cur.executemany( sqlite3.IntegrityError: UNIQUE constraint failed: feeds_last_items.url Process finished with exit code 1 ```
skobkin added this to the MVP 0.1 milestone 2022-07-09 20:02:40 +00:00
skobkin added the
bug
label 2022-07-09 20:02:40 +00:00
Miroslavsckaya was assigned by skobkin 2022-07-09 20:02:40 +00:00
skobkin added this to the RSS Bot Kanban Perdoling project 2022-07-09 20:02:40 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Miroslavsckaya/tg_rss_bot#32
No description provided.