diff --git a/scanner/migrations/000001_request.up.sql b/scanner/migrations/000001_request.up.sql index fbbbe71d..f5b13184 100644 --- a/scanner/migrations/000001_request.up.sql +++ b/scanner/migrations/000001_request.up.sql @@ -20,5 +20,5 @@ create table scanner.requests( status scanner.request_status not null default 'pending', started_at timestamptz, created_at timestamptz not null default now()::timestamptz, - constraint unique_kty unique(kind, title, year) + constraint unique_kty unique nulls not distinct (kind, title, year) ); diff --git a/scanner/scanner/models/request.py b/scanner/scanner/models/request.py index 998c55a5..4c6f7d70 100644 --- a/scanner/scanner/models/request.py +++ b/scanner/scanner/models/request.py @@ -20,6 +20,7 @@ class Request(Model, extra="allow"): id: str episodes: list[Guess.Episode] + class RequestRet(Model): id: str kind: Literal["episode", "movie"] diff --git a/scanner/scanner/routers/health.py b/scanner/scanner/routers/health.py index 07814e47..33f42d8a 100644 --- a/scanner/scanner/routers/health.py +++ b/scanner/scanner/routers/health.py @@ -13,4 +13,3 @@ def get_ready(): # child spans (`select 1` & db connection reset) was still logged, # since i don't really wanna deal with it, let's just do that. return {"status": "healthy"} -