-
Notifications
You must be signed in to change notification settings - Fork 52
Open
cyrillbolliger/planter
#1Description
Many thanks for this super handy project!
I noticed a small bug: If there are two indexes on a foreign key, the relation is duplicated even though there is only one foreign key column. Here a minimal example to reproduce the issue:
For the following table definition
create table foo
(
id serial primary key
);
create table bar
(
id serial primary key,
foo_id int references foo,
name int
);
create index on bar (foo_id);
create unique index on bar (name, foo_id);planter creates the following output
@startuml
hide circle
skinparam linetype ortho
entity "**bar**" {
+ ""id"": //serial [PK]//
--
""foo_id"": //integer [FK]//
""name"": //integer //
}
entity "**foo**" {
+ ""id"": //serial [PK]//
--
}
"**bar**" }-- "**foo**"
"**bar**" }-- "**foo**"
@endumlwhereas the correct output would be
@startuml
hide circle
skinparam linetype ortho
entity "**bar**" {
+ ""id"": //serial [PK]//
--
""foo_id"": //integer [FK]//
""name"": //integer //
}
entity "**foo**" {
+ ""id"": //serial [PK]//
--
}
"**bar**" }-- "**foo**"
@endumlReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels