From 823f026b6f0d14383e22d5f09145b66dfa1aab9d Mon Sep 17 00:00:00 2001 From: Party Wumpus <48649272+partywumpus@users.noreply.github.com> Date: Wed, 7 Feb 2024 17:28:37 +0000 Subject: [PATCH] Postgres doesn't like collate by NOCASE. but it does it by default anyway so all good --- plugin_store/database/database.py | 4 ++-- tests/db_helpers.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugin_store/database/database.py b/plugin_store/database/database.py index bf8d428..ceb52e5 100644 --- a/plugin_store/database/database.py +++ b/plugin_store/database/database.py @@ -13,7 +13,7 @@ from sqlalchemy.exc import NoResultFound, SQLAlchemyError from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine from sqlalchemy.orm import sessionmaker -from sqlalchemy.sql import collate, delete, select, update +from sqlalchemy.sql import delete, select, update from constants import SortDirection, SortType @@ -174,7 +174,7 @@ async def search( direction = desc if sort_by == SortType.NAME: - statement = statement.order_by(direction(collate(Artifact.name, "NOCASE"))) + statement = statement.order_by(direction(Artifact.name)) elif sort_by == SortType.DATE: statement = statement.order_by(direction(Artifact.created)) elif sort_by == SortType.DOWNLOADS: diff --git a/tests/db_helpers.py b/tests/db_helpers.py index 82b393e..29f121d 100644 --- a/tests/db_helpers.py +++ b/tests/db_helpers.py @@ -1,5 +1,4 @@ import random - from contextlib import asynccontextmanager from datetime import datetime, timedelta, UTC from hashlib import sha256