feat: LibraryItem.requestId nullable (scanned haves need no request) + test cleanup
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
def test_library_item_can_have_null_request(conn):
|
||||
with conn.cursor() as cur:
|
||||
cur.execute(
|
||||
'INSERT INTO "LibraryItem" (id, "requestId", artist, album, path, source, format, '
|
||||
'"qualityClass", "importedAt") '
|
||||
"VALUES (gen_random_uuid()::text, NULL, 'A', 'B', '/m/A/B', 'scan', 'FLAC', 2, now()) "
|
||||
"RETURNING id"
|
||||
)
|
||||
lib_id = cur.fetchone()[0]
|
||||
conn.commit()
|
||||
with conn.cursor() as cur:
|
||||
cur.execute('SELECT "requestId" FROM "LibraryItem" WHERE id = %s', (lib_id,))
|
||||
assert cur.fetchone()[0] is None
|
||||
Reference in New Issue
Block a user