From ee8c9086ef9373e9878f4312bcbc62230ad3ef04 Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Fri, 3 Apr 2026 01:09:48 -0400 Subject: [PATCH] added more detail to show fks that are wrong --- fixtures/database.json | 26 ++++++++++++++++++++++++-- src/database/schema.rs | 2 ++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/fixtures/database.json b/fixtures/database.json index a64fa9e..d3f71b4 100644 --- a/fixtures/database.json +++ b/fixtures/database.json @@ -240,7 +240,18 @@ "success": false, "errors": [ { - "code": "AMBIGUOUS_TYPE_RELATIONS" + "code": "AMBIGUOUS_TYPE_RELATIONS", + "details": { + "cause": "Multiple conflicting constraints found matching prefixes", + "context": [ + { + "constraint": "fk_activity_invoice_1" + }, + { + "constraint": "fk_activity_invoice_2" + } + ] + } } ] } @@ -338,7 +349,18 @@ "success": false, "errors": [ { - "code": "AMBIGUOUS_TYPE_RELATIONS" + "code": "AMBIGUOUS_TYPE_RELATIONS", + "details": { + "cause": "Multiple conflicting constraints found matching prefixes", + "context": [ + { + "constraint": "fk_junction_source_actor" + }, + { + "constraint": "fk_junction_target_actor" + } + ] + } } ] } diff --git a/src/database/schema.rs b/src/database/schema.rs index 0865352..335b0f9 100644 --- a/src/database/schema.rs +++ b/src/database/schema.rs @@ -766,6 +766,8 @@ pub(crate) fn resolve_relation<'a>( if !resolved { let mut details = crate::drop::ErrorDetails { path: path.to_string(), + context: serde_json::to_value(&matching_rels).ok(), + cause: Some("Multiple conflicting constraints found matching prefixes".to_string()), ..Default::default() }; if let Some(sid) = schema_id {