From 567009971d2fda94ff6e5ce0a7d9de26c4d60e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Fri, 6 Jan 2023 16:49:17 -0300 Subject: [PATCH] pr comment --- ci/release/changelogs/next.md | 4 ---- d2compiler/compile.go | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index f48533e7a..10b5aaf07 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -7,10 +7,6 @@ #### Bugfixes ⛑️ -- Restricts where `near` key constant values can be used, with good error messages, instead of erroring (e.g. setting `near: top-center` on a container would cause bad layouts or error). [#538](https://github.com/terrastruct/d2/pull/538) -- Fixes an error during ELK layout when images had empty labels. [#555](https://github.com/terrastruct/d2/pull/555) -- Fixes rendering classes and tables with empty headers. [#498](https://github.com/terrastruct/d2/pull/498) -- Fixes rendering sql tables with no columns. [#553](https://github.com/terrastruct/d2/pull/553) - Appendix seperator line no longer added to PNG export when appendix doesn't exist. [#582](https://github.com/terrastruct/d2/pull/582) - Watch mode only fits to screen on initial load. [#601](https://github.com/terrastruct/d2/pull/601) - Dimensions (`width`/`height`) were incorrectly giving compiler errors when applied on a shape with style. [#614](https://github.com/terrastruct/d2/pull/614) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 21e4c1cc4..48498a767 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -666,7 +666,7 @@ func (c *compiler) compileSQLTable(obj *d2graph.Object) { obj.SQLTable = &d2target.SQLTable{} parentID := obj.Parent.AbsID() - prefixTableID := obj.AbsID() + "." + tableIDPrefix := obj.AbsID() + "." for _, col := range obj.ChildrenArray { if col.IDVal == "style" { continue @@ -702,7 +702,7 @@ func (c *compiler) compileSQLTable(obj *d2graph.Object) { srcID := e.Src.AbsID() dstID := e.Dst.AbsID() // skip edges between columns of the same table - if strings.HasPrefix(srcID, prefixTableID) && strings.HasPrefix(dstID, prefixTableID) { + if strings.HasPrefix(srcID, tableIDPrefix) && strings.HasPrefix(dstID, tableIDPrefix) { continue } if srcID == absID {