1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-25 23:58:18 +01:00

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.
This commit is contained in:
Alan Orth 2020-03-01 15:42:38 +02:00
parent 82be1a4d00
commit 250fd8164f

View File

@ -264,7 +264,7 @@ with DatabaseManager() as db:
# create table to store item views and downloads # create table to store item views and downloads
cursor.execute( cursor.execute(
"""CREATE TABLE IF NOT EXISTS items """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 # commit the table creation before closing the database connection