drawdb-io / drawdb-io/drawdb

[FEATURE] Explicit Foreign Key Visualization & Validation

Open
#1,008 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
39.5k
Forks
3.2k
Avg merge
10h 46m
Merged PRs (30d)
16

Description

**Is your feature request related to a problem? Please describe.**
Currently, the application does not explicitly indicate which field acts as the foreign key. Instead, it relies entirely on the order in which tables are connected. This can lead to a poor user experience, especially for beginners, as creating relationships in the wrong direction (parent → child instead of child → parent) results in incorrect SQL being generated when exporting the schema.

**Describe the solution you'd like**
I propose adding an explicit step when creating relationships between tables. When a user connects two fields, the interface should prompt them to select which of the connected fields will act as the foreign key. This would remove ambiguity, prevent incorrect relationship definitions, and ensure that the generated SQL is accurate regardless of the connection order.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.