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**"
@enduml
whereas 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**"
@enduml
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
planter creates the following output
whereas the correct output would be