From 250fd8164fba9ccd261d22139356091acd69e346 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sun, 1 Mar 2020 15:42:38 +0200 Subject: [PATCH] dspace_statistics_api/indexer.py: Use UUID DSpace 6+ uses a UUID for item identifiers instead of an integer so we need to update the PostgreSQL schema accordingly. Solr still re- fers to them as "id" in its schema so we don't need to change anyt- hing there. --- dspace_statistics_api/indexer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace_statistics_api/indexer.py b/dspace_statistics_api/indexer.py index f9628e9..40b0506 100644 --- a/dspace_statistics_api/indexer.py +++ b/dspace_statistics_api/indexer.py @@ -264,7 +264,7 @@ with DatabaseManager() as db: # create table to store item views and downloads cursor.execute( """CREATE TABLE IF NOT EXISTS items - (id INT PRIMARY KEY, views INT DEFAULT 0, downloads INT DEFAULT 0)""" + (id UUID PRIMARY KEY, views INT DEFAULT 0, downloads INT DEFAULT 0)""" ) # commit the table creation before closing the database connection