We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cda3c3 commit e342c59Copy full SHA for e342c59
app.py
@@ -341,6 +341,20 @@ def delete(self, pathogen_id):
341
342
with get_db_cursor() as cursor:
343
if hard_delete:
344
+
345
+ # Check if there are associated schemas
346
+ cursor.execute("""
347
+ SELECT COUNT(*) as count FROM schemas
348
+ WHERE pathogen_id = %s
349
+ """, (pathogen_id,))
350
351
+ schema_count = cursor.fetchone()['count']
352
353
+ if schema_count > 0:
354
+ return {
355
+ 'error': f'Cannot delete pathogen: {schema_count} schema(s) are still associated with it. Delete schemas first or use soft delete.'
356
+ }, 400
357
358
# Hard delete - permanently remove from database
359
cursor.execute("""
360
DELETE FROM pathogens
0 commit comments