holistics / dbml

Database Markup Language (DBML), designed to define and document database structures
https://dbml.org
Apache License 2.0
2.9k stars 170 forks source link

problem with ref & sql generation #542

Open xerosanyam opened 8 months ago

xerosanyam commented 8 months ago

Hi team, I found some issues:

1. sql generation:

the following markup

ref: remfo.cards.user_id - auth.users.id

generates following sql:

ALTER TABLE "auth"."users" ADD FOREIGN KEY ("id") REFERENCES "remfo"."cards" ("user_id");

This is confusing. I feel the table we are altering should come first as it will resemble the sql query more.

2. dbdiagram should show an arrow

for syntax:

ref: remfo.cards.user_id - auth.users.id

I find following more informative:

image

than:

image

(look at the arrow)

huyphung1602 commented 8 months ago

Hi @xerosanyam,

I am Huy Phung from the dbdiagram team.

Thank you for sharing your concerns and suggestions. We're discussing it. We'll be back when there's an update.

Have an enjoyable weekend!

Best regards Huy Phung