diff --git a/go.mod b/go.mod index eb6664421..ec3c412b5 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/expr-lang/expr v1.16.9 github.com/gertd/go-pluralize v0.2.1 github.com/go-sql-driver/mysql v1.8.1 - github.com/goccy/go-graphviz v0.1.3 + github.com/goccy/go-graphviz v0.2.4 github.com/goccy/go-yaml v1.12.0 github.com/google/go-cmp v0.6.0 github.com/k1LoW/duration v1.2.0 @@ -37,7 +37,7 @@ require ( github.com/xo/dburl v0.23.2 gitlab.com/golang-commonmark/mdurl v0.0.0-20191124015652-932350d1cb84 go.mongodb.org/mongo-driver v1.17.0 - golang.org/x/image v0.20.0 + golang.org/x/image v0.21.0 golang.org/x/oauth2 v0.23.0 google.golang.org/api v0.197.0 ) @@ -83,11 +83,13 @@ require ( github.com/cli/safeexec v1.0.1 // indirect github.com/cncf/xds/go v0.0.0-20240822171458-6449f94b4d59 // indirect github.com/danieljoos/wincred v1.2.1 // indirect + github.com/disintegration/imaging v1.6.2 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/envoyproxy/go-control-plane v0.13.0 // indirect github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/flopp/go-findfont v0.1.0 // indirect github.com/fogleman/gg v1.3.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/go-faster/city v1.0.1 // indirect @@ -135,6 +137,7 @@ require ( github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect + github.com/tetratelabs/wazero v1.8.1 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect @@ -156,7 +159,7 @@ require ( golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.24.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect diff --git a/go.sum b/go.sum index 7ba7f51dd..01b5c13f0 100644 --- a/go.sum +++ b/go.sum @@ -749,8 +749,8 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20240822171458-6449f94b4d59 h1:fLZ97KE86ELjEYJCEUVzmbhfzDxHHGwBrDVMd4XL6Bs= github.com/cncf/xds/go v0.0.0-20240822171458-6449f94b4d59/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= -github.com/corona10/goimagehash v1.0.2 h1:pUfB0LnsJASMPGEZLj7tGY251vF+qLGqOgEP4rUs6kA= -github.com/corona10/goimagehash v1.0.2/go.mod h1:/l9umBhvcHQXVtQO1V6Gp1yD20STawkhRnnX0D1bvVI= +github.com/corona10/goimagehash v1.1.0 h1:teNMX/1e+Wn/AYSbLHX8mj+mF9r60R1kBeqE9MkoYwI= +github.com/corona10/goimagehash v1.1.0/go.mod h1:VkvE0mLn84L4aF8vCb6mafVajEb6QYMHl2ZJLn0mOGI= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -759,6 +759,8 @@ github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= +github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -790,6 +792,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flopp/go-findfont v0.1.0 h1:lPn0BymDUtJo+ZkV01VS3661HL6F4qFlkhcJN55u6mU= +github.com/flopp/go-findfont v0.1.0/go.mod h1:wKKxRDjD024Rh7VMwoU90i6ikQRCr+JTHB5n4Ejkqvw= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -827,8 +831,8 @@ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7a github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= -github.com/goccy/go-graphviz v0.1.3 h1:Pkt8y4FBnBNI9tfSobpoN5qy1qMNqRXPQYvLhaSUasY= -github.com/goccy/go-graphviz v0.1.3/go.mod h1:pMYpbAqJT10V8dzV1JN/g/wUlG/0imKPzn3ZsrchGCI= +github.com/goccy/go-graphviz v0.2.4 h1:3ujZoLVp7dT2lxuUPeaZvkFQtHU8E54d/LlDc/idrHQ= +github.com/goccy/go-graphviz v0.2.4/go.mod h1:hssjl/qbvUXGmloY81BwXt2nqoApKo7DFgDj5dLJGb8= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -1071,8 +1075,8 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8 github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5 h1:BvoENQQU+fZ9uukda/RzCAL/191HHwJA5b13R6diVlY= -github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= +github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= +github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= @@ -1154,6 +1158,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tenntenn/golden v0.5.4 h1:laddoKuzbzGYVinsSZyEPavPh4muyKd2SMhJTKH3F3s= github.com/tenntenn/golden v0.5.4/go.mod h1:0xI/4lpoHR65AUTmd1RKR9S1Uv0JR3yR2Q1Ob2bKqQA= +github.com/tetratelabs/wazero v1.8.1 h1:NrcgVbWfkWvVc4UtT4LRLDf91PsOzDzefMdwhLfA550= +github.com/tetratelabs/wazero v1.8.1/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= @@ -1247,6 +1253,7 @@ golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMx golang.org/x/image v0.0.0-20190507092727-e4e5bf290fec/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1256,8 +1263,8 @@ golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeap golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw= -golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM= +golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s= +golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1505,8 +1512,8 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/output/dot/templates/schema.dot.tmpl b/output/dot/templates/schema.dot.tmpl index 86c45103d..97ebd1092 100644 --- a/output/dot/templates/schema.dot.tmpl +++ b/output/dot/templates/schema.dot.tmpl @@ -19,7 +19,7 @@ digraph "{{ .Name }}" { {{ $t.Name | html }}    [{{ $t.Type | html }}]{{ if $sc }}{{ if ne $t.Comment "" }}
{{ $t.Comment | html | nl2br_slash }}{{ end }}{{ end }} {{- range $ii, $c := $t.Columns }} {{- if $c.HideForER }}{{ continue }}{{ end }} - {{ $c.Name | html }}    [{{ $c.Type | html }}]{{ if $sc }}{{ if ne $c.Comment "" }} {{ $c.Comment | html | nl2space }}{{ end }}{{ end }} + {{ $c.Name | html }} [{{ $c.Type | html }}]{{ if $sc }}{{ if ne $c.Comment "" }} {{ $c.Comment | html | nl2space }}{{ end }}{{ end }} {{- end }} >]; {{- end }} @@ -30,7 +30,7 @@ digraph "{{ .Name }}" { {{ $t.Name | html }}    [{{ $t.Type | html }}]{{ if $sc }}{{ if ne $t.Comment "" }}
{{ $t.Comment | html | nl2br_slash }}{{ end }}{{ end }} {{- range $ii, $c := $t.Columns }} {{- if $c.HideForER }}{{ continue }}{{ end }} - {{ $c.Name | html }}    [{{ $c.Type | html }}]{{ if $sc }}{{ if ne $c.Comment "" }} {{ $c.Comment | html | nl2space }}{{ end }}{{ end }} + {{ $c.Name | html }} [{{ $c.Type | html }}]{{ if $sc }}{{ if ne $c.Comment "" }} {{ $c.Comment | html | nl2space }}{{ end }}{{ end }} {{- end }} >]; {{- end }} diff --git a/output/dot/templates/table.dot.tmpl b/output/dot/templates/table.dot.tmpl index ce69712f4..4ad9d4729 100644 --- a/output/dot/templates/table.dot.tmpl +++ b/output/dot/templates/table.dot.tmpl @@ -19,7 +19,7 @@ digraph "{{ .Table.Name }}" { {{ $t.Name | html }}    [{{ $t.Type | html }}]{{ if $sc }}{{ if ne $t.Comment "" }}
{{ $t.Comment | html | nl2br_slash }}{{ end }}{{ end }} {{- range $ii, $c := $t.Columns }} {{- if $c.HideForER }}{{ continue }}{{ end }} - {{ $c.Name | html }}    [{{ $c.Type | html }}]{{ if $sc }}{{ if ne $c.Comment "" }} {{ $c.Comment | html | nl2space }}{{ end }}{{ end }} + {{ $c.Name | html }} [{{ $c.Type | html }}]{{ if $sc }}{{ if ne $c.Comment "" }} {{ $c.Comment | html | nl2space }}{{ end }}{{ end }} {{- end }} >]; {{- end }} diff --git a/output/gviz/gviz.go b/output/gviz/gviz.go index 0f4b0ae2c..5df8bcaf6 100644 --- a/output/gviz/gviz.go +++ b/output/gviz/gviz.go @@ -2,6 +2,7 @@ package gviz import ( "bytes" + "context" "fmt" "io" "os" @@ -10,6 +11,7 @@ import ( "github.com/beta/freetype/truetype" "github.com/goccy/go-graphviz" + "github.com/goccy/go-graphviz/gvc" "github.com/k1LoW/errors" "github.com/k1LoW/ffff" "github.com/k1LoW/tbls/config" @@ -62,13 +64,20 @@ func (g *Gviz) OutputViewpoint(wr io.Writer, v *schema.Viewpoint) error { } func (g *Gviz) render(wr io.Writer, b []byte) (e error) { - gviz := graphviz.New() + ctx := context.Background() + gviz, err := graphviz.New(ctx) + if err != nil { + return err + } if g.config.ER.Font != "" { faceFunc, err := getFaceFunc(g.config.ER.Font) if err != nil { return errors.WithStack(err) } - gviz.SetFontFace(faceFunc) + // FIXME: more better way + graphviz.SetFontLoader(func(ctx context.Context, job *gvc.Job, font *gvc.TextFont) (font.Face, error) { + return faceFunc(font.Size()) + }) } graph, err := graphviz.ParseBytes(b) if err != nil { @@ -82,7 +91,7 @@ func (g *Gviz) render(wr io.Writer, b []byte) (e error) { e = errors.WithStack(err) } }() - if err := gviz.Render(graph, graphviz.Format(g.config.ER.Format), wr); err != nil { + if err := gviz.Render(ctx, graph, graphviz.Format(g.config.ER.Format), wr); err != nil { return errors.WithStack(err) } return nil diff --git a/sample/adjust/administrator.blogs.svg b/sample/adjust/administrator.blogs.svg index 504935c34..1cc085333 100644 --- a/sample/adjust/administrator.blogs.svg +++ b/sample/adjust/administrator.blogs.svg @@ -1,75 +1,75 @@ - - - + + administrator.blogs - + administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id -[integer] - -user_id -[integer] - -name -[text] - -description -[text] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE diff --git a/sample/adjust/backup.blog_options.svg b/sample/adjust/backup.blog_options.svg index 858a77bc0..d5e609e6a 100644 --- a/sample/adjust/backup.blog_options.svg +++ b/sample/adjust/backup.blog_options.svg @@ -1,66 +1,66 @@ - - - + + backup.blog_options - + backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id -[integer] - -blog_id -[integer] - -label -[text] - -updated -[timestamp without time zone] - + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] + backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -dump     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE diff --git a/sample/adjust/backup.blogs.svg b/sample/adjust/backup.blogs.svg index 5a3cc1eae..4a1b0c757 100644 --- a/sample/adjust/backup.blogs.svg +++ b/sample/adjust/backup.blogs.svg @@ -1,66 +1,66 @@ - - - + + backup.blogs - + backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id -[integer] - -user_id -[integer] - -dump -[text] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id     -[integer] - -blog_id     -[integer] - -label     -[text] - -updated     -[timestamp without time zone] + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE diff --git a/sample/adjust/public.CamelizeTable.svg b/sample/adjust/public.CamelizeTable.svg index d3df00252..b7766351d 100644 --- a/sample/adjust/public.CamelizeTable.svg +++ b/sample/adjust/public.CamelizeTable.svg @@ -1,57 +1,57 @@ - - - + + public.CamelizeTable - + public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id -[uuid] - -created -[timestamp without time zone] - + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] + public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id     -[uuid] - -hyphen-column     -[text] - -CamelizeTableId     -[uuid] - -created     -[timestamp without time zone] + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE diff --git a/sample/adjust/public.comment_stars.svg b/sample/adjust/public.comment_stars.svg index 526c1cabb..e4216748e 100644 --- a/sample/adjust/public.comment_stars.svg +++ b/sample/adjust/public.comment_stars.svg @@ -1,149 +1,149 @@ - - - + + public.comment_stars - + public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id -[uuid] - -user_id -[integer] - -comment_post_id -[bigint] - -comment_user_id -[integer] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/adjust/public.comments.svg b/sample/adjust/public.comments.svg index dbdee89a5..076b3980f 100644 --- a/sample/adjust/public.comments.svg +++ b/sample/adjust/public.comments.svg @@ -1,189 +1,189 @@ - - - + + public.comments - + public.comments - - -public.comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[integer] - -comment -[text] - -post_id_desc -[bigint] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) diff --git a/sample/adjust/public.hyphen-table.svg b/sample/adjust/public.hyphen-table.svg index e4f01fe95..6620c6ea9 100644 --- a/sample/adjust/public.hyphen-table.svg +++ b/sample/adjust/public.hyphen-table.svg @@ -1,57 +1,57 @@ - - - + + public.hyphen-table - + public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id -[uuid] - -hyphen-column -[text] - -CamelizeTableId -[uuid] - -created -[timestamp without time zone] - + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] + public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id     -[uuid] - -created     -[timestamp without time zone] + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE diff --git a/sample/adjust/public.logs.svg b/sample/adjust/public.logs.svg index 752501d62..d19973136 100644 --- a/sample/adjust/public.logs.svg +++ b/sample/adjust/public.logs.svg @@ -1,189 +1,189 @@ - - - + + public.logs - + public.logs - - -public.logs -     -[BASE TABLE] - -id -[uuid] - -user_id -[integer] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[uuid] - -payload -[text] - -created -[timestamp without time zone] - + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/adjust/public.post_comment_stars.svg b/sample/adjust/public.post_comment_stars.svg index 6b49b909e..0abc5c4b6 100644 --- a/sample/adjust/public.post_comment_stars.svg +++ b/sample/adjust/public.post_comment_stars.svg @@ -1,38 +1,38 @@ - - - + + public.post_comment_stars - + public.post_comment_stars - - -public.post_comment_stars -     -[MATERIALIZED VIEW] - -id -[uuid] - -comment_user -[varchar(50)] - -comment_star_user -[varchar(50)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.post_comment_stars +     +[MATERIALIZED VIEW] + +id +[uuid] + +comment_user +[varchar(50)] + +comment_star_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + diff --git a/sample/adjust/public.post_comments.svg b/sample/adjust/public.post_comments.svg index 158094628..a351edf57 100644 --- a/sample/adjust/public.post_comments.svg +++ b/sample/adjust/public.post_comments.svg @@ -1,44 +1,44 @@ - - - + + public.post_comments - + public.post_comments - - -public.post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + diff --git a/sample/adjust/public.posts.svg b/sample/adjust/public.posts.svg index d738b7aae..2ffc7f650 100644 --- a/sample/adjust/public.posts.svg +++ b/sample/adjust/public.posts.svg @@ -1,155 +1,155 @@ - - - + + public.posts - + public.posts - - -public.posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[integer] - -title -[varchar(255)] - -body -[text] - -post_type -[post_types] - -labels -[varchar(50)[]] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/adjust/public.user_options.svg b/sample/adjust/public.user_options.svg index b7037a329..0a15c83e7 100644 --- a/sample/adjust/public.user_options.svg +++ b/sample/adjust/public.user_options.svg @@ -1,69 +1,69 @@ - - - + + public.user_options - + public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id -[integer] - -show_email -[boolean] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE diff --git a/sample/adjust/public.users.svg b/sample/adjust/public.users.svg index 34dccbf06..4eae1b9f9 100644 --- a/sample/adjust/public.users.svg +++ b/sample/adjust/public.users.svg @@ -1,251 +1,251 @@ - - - + + public.users - + public.users - - -public.users -     -[BASE TABLE] - -id -[integer] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id     -[integer] - -show_email     -[boolean] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -name     -[text] - -description     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users diff --git a/sample/adjust/schema.json b/sample/adjust/schema.json index 6b297dfa6..e3eebbbe5 100644 --- a/sample/adjust/schema.json +++ b/sample/adjust/schema.json @@ -1 +1 @@ -{"name":"testdb","desc":"Sample PostgreSQL database document.","tables":[{"name":"public.users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('users_id_seq'::regclass)","comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_pkey","def":"CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)","table":"public.users","columns":["id"],"comment":""},{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON public.users USING btree (username)","table":"public.users","columns":["username"],"comment":""},{"name":"users_email_key","def":"CREATE UNIQUE INDEX users_email_key ON public.users USING btree (email)","table":"public.users","columns":["email"],"comment":""}],"constraints":[{"name":"users_username_check","type":"CHECK","def":"CHECK ((char_length((username)::text) \u003e 4))","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.users","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"users_username_key","type":"UNIQUE","def":"UNIQUE (username)","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_email_key","type":"UNIQUE","def":"UNIQUE (email)","table":"public.users","referenced_table":"","columns":["email"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated AFTER INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when users insert or update"}],"def":""},{"name":"public.user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"boolean","nullable":false,"default":"false","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"user_options_pkey","def":"CREATE UNIQUE INDEX user_options_pkey ON public.user_options USING btree (user_id)","table":"public.user_options","columns":["user_id"],"comment":"PRIMARY KEY"}],"constraints":[{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"FK"},{"name":"user_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"public.user_options","referenced_table":"","columns":["user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('posts_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'::character varying","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"post_types","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"labels","type":"varchar(50)[]","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CREATE UNIQUE INDEX posts_id_pk ON public.posts USING btree (id)","table":"public.posts","columns":["id"],"comment":""},{"name":"posts_user_id_title_key","def":"CREATE UNIQUE INDEX posts_user_id_title_key ON public.posts USING btree (user_id, title)","table":"public.posts","columns":["title","user_id"],"comment":""},{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON public.posts USING btree (user_id)","table":"public.posts","columns":["user_id"],"comment":"posts.user_id index"}],"constraints":[{"name":"update_posts_updated","type":"TRIGGER","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","table":"public.posts","referenced_table":"","columns":["tableoid","cmax","xmax","cmin","xmin","ctid","id","user_id","title","body","post_type","labels","created","updated"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","table":"public.posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"posts -\u003e users"},{"name":"posts_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.posts","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_title_key","type":"UNIQUE","def":"UNIQUE (user_id, title)","table":"public.posts","referenced_table":"","columns":["user_id","title"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when posts update"}],"def":""},{"name":"public.comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('comments_id_seq'::regclass)","comment":""},{"name":"post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"post_id_desc","type":"bigint","nullable":true,"default":null,"comment":"","extra_def":"GENERATED ALWAYS AS (post_id * '-1'::integer) STORED"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CREATE UNIQUE INDEX comments_id_pk ON public.comments USING btree (id)","table":"public.comments","columns":["id"],"comment":""},{"name":"comments_post_id_user_id_key","def":"CREATE UNIQUE INDEX comments_post_id_user_id_key ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id)","table":"public.comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","table":"public.comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.comments","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"comments_post_id_user_id_key","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"public.comments","referenced_table":"","columns":["post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","def":"CREATE UNIQUE INDEX comment_stars_user_id_comment_post_id_comment_user_id_key ON public.comment_stars USING btree (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","columns":["comment_post_id","comment_user_id","user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","table":"public.comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","table":"public.comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_post_id","comment_user_id","comment_user_id"],"referenced_columns":["post_id","user_id","post_id","user_id"],"comment":""},{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","referenced_table":"","columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.logs","type":"BASE TABLE","comment":"audit log table","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"public.post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id,\n p.title,\n u.username AS post_user,\n c.comment,\n u2.username AS comment_user,\n c.created,\n c.updated\n FROM (((posts p\n LEFT JOIN comments c ON ((p.id = c.post_id)))\n LEFT JOIN users u ON ((u.id = p.user_id)))\n LEFT JOIN users u2 ON ((u2.id = c.user_id)))\n)","referenced_tables":["public.posts","public.comments","public.users"]},{"name":"public.post_comment_stars","type":"MATERIALIZED VIEW","comment":"","columns":[{"name":"id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"comment_star_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE MATERIALIZED VIEW post_comment_stars AS (\n SELECT cs.id,\n cu.username AS comment_user,\n csu.username AS comment_star_user,\n cs.created,\n cs.updated\n FROM (((comments c\n LEFT JOIN comment_stars cs ON (((cs.comment_post_id = c.id) AND (cs.comment_user_id = c.user_id))))\n LEFT JOIN users cu ON ((cu.id = cs.comment_user_id)))\n LEFT JOIN users csu ON ((csu.id = cs.user_id)))\n)","referenced_tables":["public.comments","public.comment_stars","public.users"]},{"name":"public.CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"CamelizeTable_id_key","def":"CREATE UNIQUE INDEX \"CamelizeTable_id_key\" ON public.\"CamelizeTable\" USING btree (id)","table":"public.CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"CamelizeTable_id_key","type":"UNIQUE","def":"UNIQUE (id)","table":"public.CamelizeTable","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"CamelizeTableId","type":"uuid","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphen-table_hyphen-column_key","def":"CREATE UNIQUE INDEX \"hyphen-table_hyphen-column_key\" ON public.\"hyphen-table\" USING btree (\"hyphen-column\")","table":"public.hyphen-table","columns":["hyphen-column"],"comment":""}],"constraints":[{"name":"hyphen-table_CamelizeTableId_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","table":"public.hyphen-table","referenced_table":"CamelizeTable","columns":["CamelizeTableId"],"referenced_columns":["id"],"comment":""},{"name":"hyphen-table_hyphen-column_key","type":"UNIQUE","def":"UNIQUE (\"hyphen-column\")","table":"public.hyphen-table","referenced_table":"","columns":["hyphen-column"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASE TABLE","comment":"admin blogs","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('administrator.blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON administrator.blogs USING btree (id)","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"administrator.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blogs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"dump","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON backup.blogs USING btree (id)","table":"backup.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blog_options","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blog_options_id_seq'::regclass)","comment":""},{"name":"blog_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"label","type":"text","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blog_options_pkey","def":"CREATE UNIQUE INDEX blog_options_pkey ON backup.blog_options USING btree (id)","table":"backup.blog_options","columns":["id"],"comment":""}],"constraints":[{"name":"blog_options_blog_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","table":"backup.blog_options","referenced_table":"blogs","columns":["blog_id"],"referenced_columns":["id"],"comment":""},{"name":"blog_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blog_options","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.bar","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"bar_pkey","def":"CREATE UNIQUE INDEX bar_pkey ON \"time\".bar USING btree (id)","table":"time.bar","columns":["id"],"comment":""}],"constraints":[{"name":"bar_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.bar","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.hyphenated-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphenated-table_pkey","def":"CREATE UNIQUE INDEX \"hyphenated-table_pkey\" ON \"time\".\"hyphenated-table\" USING btree (id)","table":"time.hyphenated-table","columns":["id"],"comment":""}],"constraints":[{"name":"hyphenated-table_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.hyphenated-table","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.referencing","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"bar_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"ht_id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"referencing_pkey","def":"CREATE UNIQUE INDEX referencing_pkey ON \"time\".referencing USING btree (id)","table":"time.referencing","columns":["id"],"comment":""}],"constraints":[{"name":"referencing_bar_id","type":"FOREIGN KEY","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","table":"time.referencing","referenced_table":"bar","columns":["bar_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_ht_id","type":"FOREIGN KEY","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","table":"time.referencing","referenced_table":"hyphenated-table","columns":["ht_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.referencing","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"public.user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","virtual":false},{"table":"public.comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id)","virtual":false},{"table":"public.comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","virtual":false},{"table":"public.hyphen-table","columns":["CamelizeTableId"],"cardinality":"Zero or more","parent_table":"public.CamelizeTable","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"backup.blog_options","columns":["blog_id"],"cardinality":"Zero or more","parent_table":"backup.blogs","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","virtual":false},{"table":"time.referencing","columns":["bar_id"],"cardinality":"Zero or more","parent_table":"time.bar","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","virtual":false},{"table":"time.referencing","columns":["ht_id"],"cardinality":"Zero or more","parent_table":"time.hyphenated-table","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","virtual":false},{"table":"public.logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"public.logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"public.comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"public.uuid_nil","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_dns","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_url","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_oid","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_x500","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1mc","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v3","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.uuid_generate_v4","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v5","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.update_updated","return_type":"trigger","arguments":"","type":"FUNCTION"},{"name":"public.reset_comment","return_type":"void","arguments":"IN comment_id integer","type":"PROCEDURE"}],"driver":{"name":"postgres","database_version":"PostgreSQL 15.7 (Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit","meta":{"current_schema":"public","search_paths":["\"$user\"","public","backup"],"dict":{"Functions":"Stored procedures and functions"}}}} +{"name":"testdb","desc":"Sample PostgreSQL database document.","tables":[{"name":"public.users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('users_id_seq'::regclass)","comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_pkey","def":"CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)","table":"public.users","columns":["id"],"comment":""},{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON public.users USING btree (username)","table":"public.users","columns":["username"],"comment":""},{"name":"users_email_key","def":"CREATE UNIQUE INDEX users_email_key ON public.users USING btree (email)","table":"public.users","columns":["email"],"comment":""}],"constraints":[{"name":"users_username_check","type":"CHECK","def":"CHECK ((char_length((username)::text) \u003e 4))","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.users","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"users_username_key","type":"UNIQUE","def":"UNIQUE (username)","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_email_key","type":"UNIQUE","def":"UNIQUE (email)","table":"public.users","referenced_table":"","columns":["email"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated AFTER INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when users insert or update"}],"def":""},{"name":"public.user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"boolean","nullable":false,"default":"false","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"user_options_pkey","def":"CREATE UNIQUE INDEX user_options_pkey ON public.user_options USING btree (user_id)","table":"public.user_options","columns":["user_id"],"comment":"PRIMARY KEY"}],"constraints":[{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"FK"},{"name":"user_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"public.user_options","referenced_table":"","columns":["user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('posts_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'::character varying","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"post_types","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"labels","type":"varchar(50)[]","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CREATE UNIQUE INDEX posts_id_pk ON public.posts USING btree (id)","table":"public.posts","columns":["id"],"comment":""},{"name":"posts_user_id_title_key","def":"CREATE UNIQUE INDEX posts_user_id_title_key ON public.posts USING btree (user_id, title)","table":"public.posts","columns":["user_id","title"],"comment":""},{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON public.posts USING btree (user_id)","table":"public.posts","columns":["user_id"],"comment":"posts.user_id index"}],"constraints":[{"name":"update_posts_updated","type":"TRIGGER","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","table":"public.posts","referenced_table":"","columns":["tableoid","cmax","xmax","cmin","xmin","ctid","id","user_id","title","body","post_type","labels","created","updated"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","table":"public.posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"posts -\u003e users"},{"name":"posts_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.posts","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_title_key","type":"UNIQUE","def":"UNIQUE (user_id, title)","table":"public.posts","referenced_table":"","columns":["user_id","title"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when posts update"}],"def":""},{"name":"public.comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('comments_id_seq'::regclass)","comment":""},{"name":"post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"post_id_desc","type":"bigint","nullable":true,"default":null,"comment":"","extra_def":"GENERATED ALWAYS AS (post_id * '-1'::integer) STORED"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CREATE UNIQUE INDEX comments_id_pk ON public.comments USING btree (id)","table":"public.comments","columns":["id"],"comment":""},{"name":"comments_post_id_user_id_key","def":"CREATE UNIQUE INDEX comments_post_id_user_id_key ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id)","table":"public.comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","table":"public.comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.comments","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"comments_post_id_user_id_key","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"public.comments","referenced_table":"","columns":["post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","def":"CREATE UNIQUE INDEX comment_stars_user_id_comment_post_id_comment_user_id_key ON public.comment_stars USING btree (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","table":"public.comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","table":"public.comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_post_id","comment_user_id","comment_user_id"],"referenced_columns":["post_id","user_id","post_id","user_id"],"comment":""},{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","referenced_table":"","columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.logs","type":"BASE TABLE","comment":"audit log table","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"public.post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id,\n p.title,\n u.username AS post_user,\n c.comment,\n u2.username AS comment_user,\n c.created,\n c.updated\n FROM (((posts p\n LEFT JOIN comments c ON ((p.id = c.post_id)))\n LEFT JOIN users u ON ((u.id = p.user_id)))\n LEFT JOIN users u2 ON ((u2.id = c.user_id)))\n)","referenced_tables":["public.posts","public.comments","public.users"]},{"name":"public.post_comment_stars","type":"MATERIALIZED VIEW","comment":"","columns":[{"name":"id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"comment_star_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE MATERIALIZED VIEW post_comment_stars AS (\n SELECT cs.id,\n cu.username AS comment_user,\n csu.username AS comment_star_user,\n cs.created,\n cs.updated\n FROM (((comments c\n LEFT JOIN comment_stars cs ON (((cs.comment_post_id = c.id) AND (cs.comment_user_id = c.user_id))))\n LEFT JOIN users cu ON ((cu.id = cs.comment_user_id)))\n LEFT JOIN users csu ON ((csu.id = cs.user_id)))\n)","referenced_tables":["public.comments","public.comment_stars","public.users"]},{"name":"public.CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"CamelizeTable_id_key","def":"CREATE UNIQUE INDEX \"CamelizeTable_id_key\" ON public.\"CamelizeTable\" USING btree (id)","table":"public.CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"CamelizeTable_id_key","type":"UNIQUE","def":"UNIQUE (id)","table":"public.CamelizeTable","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"CamelizeTableId","type":"uuid","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphen-table_hyphen-column_key","def":"CREATE UNIQUE INDEX \"hyphen-table_hyphen-column_key\" ON public.\"hyphen-table\" USING btree (\"hyphen-column\")","table":"public.hyphen-table","columns":["hyphen-column"],"comment":""}],"constraints":[{"name":"hyphen-table_CamelizeTableId_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","table":"public.hyphen-table","referenced_table":"CamelizeTable","columns":["CamelizeTableId"],"referenced_columns":["id"],"comment":""},{"name":"hyphen-table_hyphen-column_key","type":"UNIQUE","def":"UNIQUE (\"hyphen-column\")","table":"public.hyphen-table","referenced_table":"","columns":["hyphen-column"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASE TABLE","comment":"admin blogs","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('administrator.blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON administrator.blogs USING btree (id)","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"administrator.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blogs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"dump","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON backup.blogs USING btree (id)","table":"backup.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blog_options","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blog_options_id_seq'::regclass)","comment":""},{"name":"blog_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"label","type":"text","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blog_options_pkey","def":"CREATE UNIQUE INDEX blog_options_pkey ON backup.blog_options USING btree (id)","table":"backup.blog_options","columns":["id"],"comment":""}],"constraints":[{"name":"blog_options_blog_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","table":"backup.blog_options","referenced_table":"blogs","columns":["blog_id"],"referenced_columns":["id"],"comment":""},{"name":"blog_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blog_options","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.bar","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"bar_pkey","def":"CREATE UNIQUE INDEX bar_pkey ON \"time\".bar USING btree (id)","table":"time.bar","columns":["id"],"comment":""}],"constraints":[{"name":"bar_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.bar","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.hyphenated-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphenated-table_pkey","def":"CREATE UNIQUE INDEX \"hyphenated-table_pkey\" ON \"time\".\"hyphenated-table\" USING btree (id)","table":"time.hyphenated-table","columns":["id"],"comment":""}],"constraints":[{"name":"hyphenated-table_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.hyphenated-table","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.referencing","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"bar_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"ht_id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"referencing_pkey","def":"CREATE UNIQUE INDEX referencing_pkey ON \"time\".referencing USING btree (id)","table":"time.referencing","columns":["id"],"comment":""}],"constraints":[{"name":"referencing_bar_id","type":"FOREIGN KEY","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","table":"time.referencing","referenced_table":"bar","columns":["bar_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_ht_id","type":"FOREIGN KEY","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","table":"time.referencing","referenced_table":"hyphenated-table","columns":["ht_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.referencing","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"public.user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","virtual":false},{"table":"public.comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id)","virtual":false},{"table":"public.comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","virtual":false},{"table":"public.hyphen-table","columns":["CamelizeTableId"],"cardinality":"Zero or more","parent_table":"public.CamelizeTable","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"backup.blog_options","columns":["blog_id"],"cardinality":"Zero or more","parent_table":"backup.blogs","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","virtual":false},{"table":"time.referencing","columns":["bar_id"],"cardinality":"Zero or more","parent_table":"time.bar","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","virtual":false},{"table":"time.referencing","columns":["ht_id"],"cardinality":"Zero or more","parent_table":"time.hyphenated-table","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","virtual":false},{"table":"public.logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"public.logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"public.comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"public.uuid_nil","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_dns","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_url","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_oid","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_x500","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1mc","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v3","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.uuid_generate_v4","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v5","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.update_updated","return_type":"trigger","arguments":"","type":"FUNCTION"},{"name":"public.reset_comment","return_type":"void","arguments":"IN comment_id integer","type":"PROCEDURE"}],"enums":[{"name":"public.post_types","values":["draft","private","public"]}],"driver":{"name":"postgres","database_version":"PostgreSQL 15.8 (Debian 15.8-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit","meta":{"current_schema":"public","search_paths":["postgres","public","backup"],"dict":{"Functions":"Stored procedures and functions"}}}} diff --git a/sample/adjust/schema.svg b/sample/adjust/schema.svg index d37bbb43a..9bb4f9ddb 100644 --- a/sample/adjust/schema.svg +++ b/sample/adjust/schema.svg @@ -1,490 +1,490 @@ - - - + + testdb - + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id     -[integer] - -show_email     -[boolean] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation public.post_comments - - -public.post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.post_comment_stars - - -public.post_comment_stars -     -[MATERIALIZED VIEW] - -id     -[uuid] - -comment_user     -[varchar(50)] - -comment_star_user     -[varchar(50)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.post_comment_stars +     +[MATERIALIZED VIEW] + +id +[uuid] + +comment_user +[varchar(50)] + +comment_star_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id     -[uuid] - -created     -[timestamp without time zone] + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id     -[uuid] - -hyphen-column     -[text] - -CamelizeTableId     -[uuid] - -created     -[timestamp without time zone] + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -name     -[text] - -description     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -dump     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id     -[integer] - -blog_id     -[integer] - -label     -[text] - -updated     -[timestamp without time zone] + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE time.bar - - -time.bar -     -[BASE TABLE] - -id     -[integer] + + +time.bar +     +[BASE TABLE] + +id +[integer] time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id     -[integer] + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/adjust/time.bar.svg b/sample/adjust/time.bar.svg index 414a70543..4689ff73b 100644 --- a/sample/adjust/time.bar.svg +++ b/sample/adjust/time.bar.svg @@ -1,51 +1,51 @@ - - - + + time.bar - + time.bar - - -time.bar -     -[BASE TABLE] - -id -[integer] - + + +time.bar +     +[BASE TABLE] + +id +[integer] + time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) diff --git a/sample/adjust/time.hyphenated-table.svg b/sample/adjust/time.hyphenated-table.svg index a4f994d60..4b639940f 100644 --- a/sample/adjust/time.hyphenated-table.svg +++ b/sample/adjust/time.hyphenated-table.svg @@ -1,51 +1,51 @@ - - - + + time.hyphenated-table - + time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id -[integer] - + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] + time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/adjust/time.referencing.svg b/sample/adjust/time.referencing.svg index b224b74c2..e85bb6a69 100644 --- a/sample/adjust/time.referencing.svg +++ b/sample/adjust/time.referencing.svg @@ -1,70 +1,70 @@ - - - + + time.referencing - + time.referencing - - -time.referencing -     -[BASE TABLE] - -id -[integer] - -bar_id -[integer] - -ht_id -[integer] - + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] + time.bar - - -time.bar -     -[BASE TABLE] - -id     -[integer] + + +time.bar +     +[BASE TABLE] + +id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id     -[integer] + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/clickhouse/id_value_dictionary.svg b/sample/clickhouse/id_value_dictionary.svg index a1596bbcf..a9d7191cd 100644 --- a/sample/clickhouse/id_value_dictionary.svg +++ b/sample/clickhouse/id_value_dictionary.svg @@ -1,29 +1,29 @@ - - - + + id_value_dictionary - + id_value_dictionary - - -id_value_dictionary -     -[Dictionary] - -id -[UInt64] - -value -[String] - + + +id_value_dictionary +     +[Dictionary] + +id +[UInt64] + +value +[String] + diff --git a/sample/clickhouse/materialized_view.svg b/sample/clickhouse/materialized_view.svg index d3d89c44c..b9310e241 100644 --- a/sample/clickhouse/materialized_view.svg +++ b/sample/clickhouse/materialized_view.svg @@ -1,29 +1,29 @@ - - - + + materialized_view - + materialized_view - - -materialized_view -     -[MaterializedView] - -name1 -[UInt64] - -name2 -[Nullable(String)] - + + +materialized_view +     +[MaterializedView] + +name1 +[UInt64] + +name2 +[Nullable(String)] + diff --git a/sample/clickhouse/numbers_table.svg b/sample/clickhouse/numbers_table.svg index ad72a87ba..486be6f2a 100644 --- a/sample/clickhouse/numbers_table.svg +++ b/sample/clickhouse/numbers_table.svg @@ -1,26 +1,26 @@ - - - + + numbers_table - + numbers_table - - -numbers_table -     -[SystemNumbers] - -number -[UInt64] - + + +numbers_table +     +[SystemNumbers] + +number +[UInt64] + diff --git a/sample/clickhouse/schema.svg b/sample/clickhouse/schema.svg index 0d3d6a7e8..872c422c5 100644 --- a/sample/clickhouse/schema.svg +++ b/sample/clickhouse/schema.svg @@ -1,139 +1,139 @@ - - - + + testdb - + id_value_dictionary - - -id_value_dictionary -     -[Dictionary] - -id     -[UInt64] - -value     -[String] + + +id_value_dictionary +     +[Dictionary] + +id +[UInt64] + +value +[String] materialized_view - - -materialized_view -     -[MaterializedView] - -name1     -[UInt64] - -name2     -[Nullable(String)] + + +materialized_view +     +[MaterializedView] + +name1 +[UInt64] + +name2 +[Nullable(String)] numbers_table - - -numbers_table -     -[SystemNumbers] - -number     -[UInt64] + + +numbers_table +     +[SystemNumbers] + +number +[UInt64] source_table - - -source_table -     -[MergeTree] - -id     -[UInt64] - -value     -[String] + + +source_table +     +[MergeTree] + +id +[UInt64] + +value +[String] t1 - - -t1 -     -[Memory] - -x     -[String] + + +t1 +     +[Memory] + +x +[String] table_name - - -table_name -     -[MergeTree] - -name1     -[UInt64] - -name2     -[Nullable(String)] - -name3     -[LowCardinality(String)] - -name4     -[SimpleAggregateFunction(sum, Float64)] - -name5     -[DateTime] - -name6     -[String] - -name7     -[String] - -name8     -[FixedString(4)] + + +table_name +     +[MergeTree] + +name1 +[UInt64] + +name2 +[Nullable(String)] + +name3 +[LowCardinality(String)] + +name4 +[SimpleAggregateFunction(sum, Float64)] + +name5 +[DateTime] + +name6 +[String] + +name7 +[String] + +name8 +[FixedString(4)] view - - -view -     -[View] - -name1     -[UInt64] - -name2     -[Nullable(String)] - -name4     -[SimpleAggregateFunction(sum, Float64)] - -name5     -[DateTime] - -name8     -[FixedString(4)] + + +view +     +[View] + +name1 +[UInt64] + +name2 +[Nullable(String)] + +name4 +[SimpleAggregateFunction(sum, Float64)] + +name5 +[DateTime] + +name8 +[FixedString(4)] diff --git a/sample/clickhouse/source_table.svg b/sample/clickhouse/source_table.svg index b788f0c8b..74144719e 100644 --- a/sample/clickhouse/source_table.svg +++ b/sample/clickhouse/source_table.svg @@ -1,29 +1,29 @@ - - - + + source_table - + source_table - - -source_table -     -[MergeTree] - -id -[UInt64] - -value -[String] - + + +source_table +     +[MergeTree] + +id +[UInt64] + +value +[String] + diff --git a/sample/clickhouse/t1.svg b/sample/clickhouse/t1.svg index 30fe4d236..f84a1c109 100644 --- a/sample/clickhouse/t1.svg +++ b/sample/clickhouse/t1.svg @@ -1,26 +1,26 @@ - - - + + t1 - + t1 - - -t1 -     -[Memory] - -x -[String] - + + +t1 +     +[Memory] + +x +[String] + diff --git a/sample/clickhouse/table_name.svg b/sample/clickhouse/table_name.svg index f8df9bdf0..cfeae1ded 100644 --- a/sample/clickhouse/table_name.svg +++ b/sample/clickhouse/table_name.svg @@ -1,47 +1,47 @@ - - - + + table_name - + table_name - - -table_name -     -[MergeTree] - -name1 -[UInt64] - -name2 -[Nullable(String)] - -name3 -[LowCardinality(String)] - -name4 -[SimpleAggregateFunction(sum, Float64)] - -name5 -[DateTime] - -name6 -[String] - -name7 -[String] - -name8 -[FixedString(4)] - + + +table_name +     +[MergeTree] + +name1 +[UInt64] + +name2 +[Nullable(String)] + +name3 +[LowCardinality(String)] + +name4 +[SimpleAggregateFunction(sum, Float64)] + +name5 +[DateTime] + +name6 +[String] + +name7 +[String] + +name8 +[FixedString(4)] + diff --git a/sample/clickhouse/view.svg b/sample/clickhouse/view.svg index 8739b7196..7a959a47b 100644 --- a/sample/clickhouse/view.svg +++ b/sample/clickhouse/view.svg @@ -1,38 +1,38 @@ - - - + + view - + view - - -view -     -[View] - -name1 -[UInt64] - -name2 -[Nullable(String)] - -name4 -[SimpleAggregateFunction(sum, Float64)] - -name5 -[DateTime] - -name8 -[FixedString(4)] - + + +view +     +[View] + +name1 +[UInt64] + +name2 +[Nullable(String)] + +name4 +[SimpleAggregateFunction(sum, Float64)] + +name5 +[DateTime] + +name8 +[FixedString(4)] + diff --git a/sample/detect_relations/CamelizeTable.svg b/sample/detect_relations/CamelizeTable.svg index d4a255f5c..a3a027ed8 100644 --- a/sample/detect_relations/CamelizeTable.svg +++ b/sample/detect_relations/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/detect_relations/comment_stars.svg b/sample/detect_relations/comment_stars.svg index e879789af..b1b11593f 100644 --- a/sample/detect_relations/comment_stars.svg +++ b/sample/detect_relations/comment_stars.svg @@ -1,112 +1,112 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:user_id->users:id - - -Detected Relation + + +Detected Relation logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations/comments.svg b/sample/detect_relations/comments.svg index 740242f2b..391f6e148 100644 --- a/sample/detect_relations/comments.svg +++ b/sample/detect_relations/comments.svg @@ -1,149 +1,149 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -Detected Relation + + +Detected Relation users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -Detected Relation + + +Detected Relation logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_id->comments:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations/hyphen-table.svg b/sample/detect_relations/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/detect_relations/hyphen-table.svg +++ b/sample/detect_relations/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/detect_relations/logs.svg b/sample/detect_relations/logs.svg index cc5039157..82cfe1db8 100644 --- a/sample/detect_relations/logs.svg +++ b/sample/detect_relations/logs.svg @@ -1,183 +1,183 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] logs:user_id->users:id - - -Detected Relation + + +Detected Relation posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] logs:post_id->posts:id - - -Detected Relation + + +Detected Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] logs:comment_id->comments:id - - -Detected Relation + + +Detected Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] logs:comment_star_id->comment_stars:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations/post_comments.svg b/sample/detect_relations/post_comments.svg index 1d625b0da..e0fb69b9f 100644 --- a/sample/detect_relations/post_comments.svg +++ b/sample/detect_relations/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/detect_relations/posts.svg b/sample/detect_relations/posts.svg index 57d3e9c9e..1495b17e8 100644 --- a/sample/detect_relations/posts.svg +++ b/sample/detect_relations/posts.svg @@ -1,149 +1,149 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -Detected Relation + + +Detected Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -Detected Relation + + +Detected Relation logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:post_id->posts:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations/schema.svg b/sample/detect_relations/schema.svg index f652c42cb..42ee2df7c 100644 --- a/sample/detect_relations/schema.svg +++ b/sample/detect_relations/schema.svg @@ -1,301 +1,301 @@ - - - + + relations - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:user_id->users:id - - -Detected Relation + + +Detected Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -Detected Relation + + +Detected Relation comments:user_id->users:id - - -Detected Relation + + +Detected Relation hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Detected Relation + + +Detected Relation logs:comment_id->comments:id - - -Detected Relation + + +Detected Relation logs:post_id->posts:id - - -Detected Relation + + +Detected Relation logs:user_id->users:id - - -Detected Relation + + +Detected Relation post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -Detected Relation + + +Detected Relation user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/detect_relations/user_options.svg b/sample/detect_relations/user_options.svg index eef6f0049..aa9aa9ed2 100644 --- a/sample/detect_relations/user_options.svg +++ b/sample/detect_relations/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/detect_relations/users.svg b/sample/detect_relations/users.svg index 4497076c5..9c55fe037 100644 --- a/sample/detect_relations/users.svg +++ b/sample/detect_relations/users.svg @@ -1,211 +1,211 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:user_id->users:id - - -Detected Relation + + +Detected Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -Detected Relation + + +Detected Relation logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:user_id->users:id - - -Detected Relation + + +Detected Relation posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations_singular/CamelizeTable.svg b/sample/detect_relations_singular/CamelizeTable.svg index d4a255f5c..a3a027ed8 100644 --- a/sample/detect_relations_singular/CamelizeTable.svg +++ b/sample/detect_relations_singular/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/detect_relations_singular/comment.svg b/sample/detect_relations_singular/comment.svg index b88a4423b..5d5322b5a 100644 --- a/sample/detect_relations_singular/comment.svg +++ b/sample/detect_relations_singular/comment.svg @@ -1,149 +1,149 @@ - - - + + comment - + comment - - -comment -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -created -[datetime] - -updated -[datetime] - + + +comment +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] + post - - -post -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +post +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comment:post_id->post:id - - -Detected Relation + + +Detected Relation user - - -user -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +user +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment:user_id->user:id - - -Detected Relation + + +Detected Relation log - - -log -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +log +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] log:comment_id->comment:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations_singular/comment_star.svg b/sample/detect_relations_singular/comment_star.svg index efb8358ce..7587f0398 100644 --- a/sample/detect_relations_singular/comment_star.svg +++ b/sample/detect_relations_singular/comment_star.svg @@ -1,112 +1,112 @@ - - - + + comment_star - + comment_star - - -comment_star -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_star +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + user - - -user -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +user +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_star:user_id->user:id - - -Detected Relation + + +Detected Relation log - - -log -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +log +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] log:comment_star_id->comment_star:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations_singular/hyphen-table.svg b/sample/detect_relations_singular/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/detect_relations_singular/hyphen-table.svg +++ b/sample/detect_relations_singular/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/detect_relations_singular/log.svg b/sample/detect_relations_singular/log.svg index cad9766b1..b7ef8b9dd 100644 --- a/sample/detect_relations_singular/log.svg +++ b/sample/detect_relations_singular/log.svg @@ -1,183 +1,183 @@ - - - + + log - + log - - -log -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - -payload -[text] - -created -[datetime] - + + +log +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] + user - - -user -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +user +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] log:user_id->user:id - - -Detected Relation + + +Detected Relation post - - -post -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +post +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] log:post_id->post:id - - -Detected Relation + + +Detected Relation comment - - -comment -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comment +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] log:comment_id->comment:id - - -Detected Relation + + +Detected Relation comment_star - - -comment_star -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_star +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] log:comment_star_id->comment_star:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations_singular/post.svg b/sample/detect_relations_singular/post.svg index 70ff7cd23..1504de34f 100644 --- a/sample/detect_relations_singular/post.svg +++ b/sample/detect_relations_singular/post.svg @@ -1,149 +1,149 @@ - - - + + post - + post - - -post -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +post +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + user - - -user -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +user +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] post:user_id->user:id - - -Detected Relation + + +Detected Relation comment - - -comment -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comment +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] comment:post_id->post:id - - -Detected Relation + + +Detected Relation log - - -log -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +log +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] log:post_id->post:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations_singular/post_comment.svg b/sample/detect_relations_singular/post_comment.svg index bfff26767..a6b06f78b 100644 --- a/sample/detect_relations_singular/post_comment.svg +++ b/sample/detect_relations_singular/post_comment.svg @@ -1,44 +1,44 @@ - - - + + post_comment - + post_comment - - -post_comment -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comment +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/detect_relations_singular/schema.svg b/sample/detect_relations_singular/schema.svg index 83cd3898e..c2d9c58e3 100644 --- a/sample/detect_relations_singular/schema.svg +++ b/sample/detect_relations_singular/schema.svg @@ -1,301 +1,301 @@ - - - + + relations_singular - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] comment - - -comment -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comment +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] post - - -post -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +post +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comment:post_id->post:id - - -Detected Relation + + +Detected Relation user - - -user -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +user +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment:user_id->user:id - - -Detected Relation + + +Detected Relation comment_star - - -comment_star -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_star +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_star:user_id->user:id - - -Detected Relation + + +Detected Relation hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] log - - -log -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +log +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] log:comment_id->comment:id - - -Detected Relation + + +Detected Relation log:comment_star_id->comment_star:id - - -Detected Relation + + +Detected Relation log:post_id->post:id - - -Detected Relation + + +Detected Relation log:user_id->user:id - - -Detected Relation + + +Detected Relation post:user_id->user:id - - -Detected Relation + + +Detected Relation post_comment - - -post_comment -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comment +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] user_option - - -user_option -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_option +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_option:user_id->user:id - - -FOREIGN KEY (user_id) REFERENCES user (id) + + +FOREIGN KEY (user_id) REFERENCES user (id) diff --git a/sample/detect_relations_singular/user.svg b/sample/detect_relations_singular/user.svg index abcb7f3aa..a5b1777d7 100644 --- a/sample/detect_relations_singular/user.svg +++ b/sample/detect_relations_singular/user.svg @@ -1,211 +1,211 @@ - - - + + user - + user - - -user -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +user +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + user_option - - -user_option -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_option +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_option:user_id->user:id - - -FOREIGN KEY (user_id) REFERENCES user (id) + + +FOREIGN KEY (user_id) REFERENCES user (id) comment - - -comment -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comment +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +created +[datetime] + +updated +[datetime] comment:user_id->user:id - - -Detected Relation + + +Detected Relation comment_star - - -comment_star -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_star +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_star:user_id->user:id - - -Detected Relation + + +Detected Relation log - - -log -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +log +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] log:user_id->user:id - - -Detected Relation + + +Detected Relation post - - -post -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +post +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] post:user_id->user:id - - -Detected Relation + + +Detected Relation diff --git a/sample/detect_relations_singular/user_option.svg b/sample/detect_relations_singular/user_option.svg index 993eeff5d..2d96074b2 100644 --- a/sample/detect_relations_singular/user_option.svg +++ b/sample/detect_relations_singular/user_option.svg @@ -1,69 +1,69 @@ - - - + + user_option - + user_option - - -user_option -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_option +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + user - - -user -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +user +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_option:user_id->user:id - - -FOREIGN KEY (user_id) REFERENCES user (id) + + +FOREIGN KEY (user_id) REFERENCES user (id) diff --git a/sample/dict/CamelizeTable.svg b/sample/dict/CamelizeTable.svg index d4a255f5c..a3a027ed8 100644 --- a/sample/dict/CamelizeTable.svg +++ b/sample/dict/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/dict/comment_stars.svg b/sample/dict/comment_stars.svg index 456c49224..841905fe9 100644 --- a/sample/dict/comment_stars.svg +++ b/sample/dict/comment_stars.svg @@ -1,112 +1,112 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) diff --git a/sample/dict/comments.svg b/sample/dict/comments.svg index e01945d35..838e8f573 100644 --- a/sample/dict/comments.svg +++ b/sample/dict/comments.svg @@ -1,149 +1,149 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -post_id_desc -[bigint] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/dict/hyphen-table.svg b/sample/dict/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/dict/hyphen-table.svg +++ b/sample/dict/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/dict/logs.svg b/sample/dict/logs.svg index a2a33c513..8357a9080 100644 --- a/sample/dict/logs.svg +++ b/sample/dict/logs.svg @@ -1,44 +1,44 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] + diff --git a/sample/dict/long_long_long_long_long_long_long_long_table_name.svg b/sample/dict/long_long_long_long_long_long_long_long_table_name.svg index ae5169c4d..02e219e39 100644 --- a/sample/dict/long_long_long_long_long_long_long_long_table_name.svg +++ b/sample/dict/long_long_long_long_long_long_long_long_table_name.svg @@ -1,29 +1,29 @@ - - - + + long_long_long_long_long_long_long_long_table_name - + long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/dict/post_comments.svg b/sample/dict/post_comments.svg index 1d625b0da..e0fb69b9f 100644 --- a/sample/dict/post_comments.svg +++ b/sample/dict/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/dict/posts.svg b/sample/dict/posts.svg index df99fdc67..9ed4f8a09 100644 --- a/sample/dict/posts.svg +++ b/sample/dict/posts.svg @@ -1,115 +1,115 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) diff --git a/sample/dict/schema.svg b/sample/dict/schema.svg index 4870e3d7f..e45f12e78 100644 --- a/sample/dict/schema.svg +++ b/sample/dict/schema.svg @@ -1,298 +1,298 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/dict/user_options.svg b/sample/dict/user_options.svg index eef6f0049..aa9aa9ed2 100644 --- a/sample/dict/user_options.svg +++ b/sample/dict/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/dict/users.svg b/sample/dict/users.svg index ef4ca9cb3..15bc1fe4a 100644 --- a/sample/dict/users.svg +++ b/sample/dict/users.svg @@ -1,177 +1,177 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/dynamodb/Forum.svg b/sample/dynamodb/Forum.svg index e59194fde..3ebf51d3a 100644 --- a/sample/dynamodb/Forum.svg +++ b/sample/dynamodb/Forum.svg @@ -1,48 +1,48 @@ - - - + + Forum - + Forum - - -Forum -     -[BASIC TABLE] - -Name -[S] - + + +Forum +     +[BASIC TABLE] + +Name +[S] + Thread - - -Thread -     -[BASIC TABLE] - -ForumName     -[S] - -Subject     -[S] + + +Thread +     +[BASIC TABLE] + +ForumName +[S] + +Subject +[S] Thread:ForumName->Forum:Name - - -Thread->Forum + + +Thread->Forum diff --git a/sample/dynamodb/ProductCatalog.svg b/sample/dynamodb/ProductCatalog.svg index 1b8ef7a34..6cca79da2 100644 --- a/sample/dynamodb/ProductCatalog.svg +++ b/sample/dynamodb/ProductCatalog.svg @@ -1,26 +1,26 @@ - - - + + ProductCatalog - + ProductCatalog - - -ProductCatalog -     -[BASIC TABLE] - -Id -[N] - + + +ProductCatalog +     +[BASIC TABLE] + +Id +[N] + diff --git a/sample/dynamodb/Reply.svg b/sample/dynamodb/Reply.svg index 99ced2d1d..449c12b76 100644 --- a/sample/dynamodb/Reply.svg +++ b/sample/dynamodb/Reply.svg @@ -1,32 +1,32 @@ - - - + + Reply - + Reply - - -Reply -     -[BASIC TABLE] - -Id -[S] - -ReplyDateTime -[S] - -PostedBy -[S] - + + +Reply +     +[BASIC TABLE] + +Id +[S] + +ReplyDateTime +[S] + +PostedBy +[S] + diff --git a/sample/dynamodb/Thread.svg b/sample/dynamodb/Thread.svg index 39e005439..7c84d55e5 100644 --- a/sample/dynamodb/Thread.svg +++ b/sample/dynamodb/Thread.svg @@ -1,48 +1,48 @@ - - - + + Thread - + Thread - - -Thread -     -[BASIC TABLE] - -ForumName -[S] - -Subject -[S] - + + +Thread +     +[BASIC TABLE] + +ForumName +[S] + +Subject +[S] + Forum - - -Forum -     -[BASIC TABLE] - -Name     -[S] + + +Forum +     +[BASIC TABLE] + +Name +[S] Thread:ForumName->Forum:Name - - -Thread->Forum + + +Thread->Forum diff --git a/sample/dynamodb/schema.svg b/sample/dynamodb/schema.svg index 7f42bdd1b..2cf9d1f49 100644 --- a/sample/dynamodb/schema.svg +++ b/sample/dynamodb/schema.svg @@ -1,77 +1,77 @@ - - - + + Amazon DynamoDB (ap-northeast-1) - + Forum - - -Forum -     -[BASIC TABLE] - -Name     -[S] + + +Forum +     +[BASIC TABLE] + +Name +[S] ProductCatalog - - -ProductCatalog -     -[BASIC TABLE] - -Id     -[N] + + +ProductCatalog +     +[BASIC TABLE] + +Id +[N] Reply - - -Reply -     -[BASIC TABLE] - -Id     -[S] - -ReplyDateTime     -[S] - -PostedBy     -[S] + + +Reply +     +[BASIC TABLE] + +Id +[S] + +ReplyDateTime +[S] + +PostedBy +[S] Thread - - -Thread -     -[BASIC TABLE] - -ForumName     -[S] - -Subject     -[S] + + +Thread +     +[BASIC TABLE] + +ForumName +[S] + +Subject +[S] Thread:ForumName->Forum:Name - - -Thread->Forum + + +Thread->Forum diff --git a/sample/exclude/comment_stars.svg b/sample/exclude/comment_stars.svg index 456c49224..841905fe9 100644 --- a/sample/exclude/comment_stars.svg +++ b/sample/exclude/comment_stars.svg @@ -1,112 +1,112 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) diff --git a/sample/exclude/comments.svg b/sample/exclude/comments.svg index e01945d35..838e8f573 100644 --- a/sample/exclude/comments.svg +++ b/sample/exclude/comments.svg @@ -1,149 +1,149 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -post_id_desc -[bigint] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/exclude/hyphen-table.svg b/sample/exclude/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/exclude/hyphen-table.svg +++ b/sample/exclude/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/exclude/long_long_long_long_long_long_long_long_table_name.svg b/sample/exclude/long_long_long_long_long_long_long_long_table_name.svg index ae5169c4d..02e219e39 100644 --- a/sample/exclude/long_long_long_long_long_long_long_long_table_name.svg +++ b/sample/exclude/long_long_long_long_long_long_long_long_table_name.svg @@ -1,29 +1,29 @@ - - - + + long_long_long_long_long_long_long_long_table_name - + long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/exclude/post_comments.svg b/sample/exclude/post_comments.svg index 1d625b0da..e0fb69b9f 100644 --- a/sample/exclude/post_comments.svg +++ b/sample/exclude/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/exclude/posts.svg b/sample/exclude/posts.svg index df99fdc67..9ed4f8a09 100644 --- a/sample/exclude/posts.svg +++ b/sample/exclude/posts.svg @@ -1,115 +1,115 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) diff --git a/sample/exclude/schema.svg b/sample/exclude/schema.svg index 8faf59db6..bf81f9d2b 100644 --- a/sample/exclude/schema.svg +++ b/sample/exclude/schema.svg @@ -1,253 +1,253 @@ - - - + + testdb - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/exclude/user_options.svg b/sample/exclude/user_options.svg index eef6f0049..aa9aa9ed2 100644 --- a/sample/exclude/user_options.svg +++ b/sample/exclude/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/exclude/users.svg b/sample/exclude/users.svg index ef4ca9cb3..15bc1fe4a 100644 --- a/sample/exclude/users.svg +++ b/sample/exclude/users.svg @@ -1,177 +1,177 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/font/CamelizeTable.png b/sample/font/CamelizeTable.png index a004dd56c..4bc949c19 100644 Binary files a/sample/font/CamelizeTable.png and b/sample/font/CamelizeTable.png differ diff --git a/sample/font/comment_stars.png b/sample/font/comment_stars.png index 3fd1ae068..4129854ab 100644 Binary files a/sample/font/comment_stars.png and b/sample/font/comment_stars.png differ diff --git a/sample/font/comments.png b/sample/font/comments.png index 80364ea90..314fb79aa 100644 Binary files a/sample/font/comments.png and b/sample/font/comments.png differ diff --git a/sample/font/hyphen-table.png b/sample/font/hyphen-table.png index 43c3a1545..34a37acee 100644 Binary files a/sample/font/hyphen-table.png and b/sample/font/hyphen-table.png differ diff --git a/sample/font/logs.png b/sample/font/logs.png index 65c112502..76ca6d3c7 100644 Binary files a/sample/font/logs.png and b/sample/font/logs.png differ diff --git a/sample/font/long_long_long_long_long_long_long_long_table_name.png b/sample/font/long_long_long_long_long_long_long_long_table_name.png index c4e845684..7168c3ebe 100644 Binary files a/sample/font/long_long_long_long_long_long_long_long_table_name.png and b/sample/font/long_long_long_long_long_long_long_long_table_name.png differ diff --git a/sample/font/post_comments.png b/sample/font/post_comments.png index 0015c8e73..f5f98f0ad 100644 Binary files a/sample/font/post_comments.png and b/sample/font/post_comments.png differ diff --git a/sample/font/posts.png b/sample/font/posts.png index ae62dc3ea..c74aaddea 100644 Binary files a/sample/font/posts.png and b/sample/font/posts.png differ diff --git a/sample/font/schema.png b/sample/font/schema.png index d11d96847..6e71c330b 100644 Binary files a/sample/font/schema.png and b/sample/font/schema.png differ diff --git a/sample/font/user_options.png b/sample/font/user_options.png index 7175031b1..9b22d5600 100644 Binary files a/sample/font/user_options.png and b/sample/font/user_options.png differ diff --git a/sample/font/users.png b/sample/font/users.png index f1f859cba..63133fd05 100644 Binary files a/sample/font/users.png and b/sample/font/users.png differ diff --git a/sample/hide/CamelizeTable.svg b/sample/hide/CamelizeTable.svg index d4a255f5c..a3a027ed8 100644 --- a/sample/hide/CamelizeTable.svg +++ b/sample/hide/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/hide/comment_stars.svg b/sample/hide/comment_stars.svg index 456c49224..841905fe9 100644 --- a/sample/hide/comment_stars.svg +++ b/sample/hide/comment_stars.svg @@ -1,112 +1,112 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) diff --git a/sample/hide/comments.svg b/sample/hide/comments.svg index e01945d35..838e8f573 100644 --- a/sample/hide/comments.svg +++ b/sample/hide/comments.svg @@ -1,149 +1,149 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -post_id_desc -[bigint] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/hide/hyphen-table.svg b/sample/hide/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/hide/hyphen-table.svg +++ b/sample/hide/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/hide/logs.svg b/sample/hide/logs.svg index a2a33c513..8357a9080 100644 --- a/sample/hide/logs.svg +++ b/sample/hide/logs.svg @@ -1,44 +1,44 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] + diff --git a/sample/hide/long_long_long_long_long_long_long_long_table_name.svg b/sample/hide/long_long_long_long_long_long_long_long_table_name.svg index ae5169c4d..02e219e39 100644 --- a/sample/hide/long_long_long_long_long_long_long_long_table_name.svg +++ b/sample/hide/long_long_long_long_long_long_long_long_table_name.svg @@ -1,29 +1,29 @@ - - - + + long_long_long_long_long_long_long_long_table_name - + long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/hide/post_comments.svg b/sample/hide/post_comments.svg index 1d625b0da..e0fb69b9f 100644 --- a/sample/hide/post_comments.svg +++ b/sample/hide/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/hide/posts.svg b/sample/hide/posts.svg index df99fdc67..9ed4f8a09 100644 --- a/sample/hide/posts.svg +++ b/sample/hide/posts.svg @@ -1,115 +1,115 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) diff --git a/sample/hide/schema.svg b/sample/hide/schema.svg index 4870e3d7f..e45f12e78 100644 --- a/sample/hide/schema.svg +++ b/sample/hide/schema.svg @@ -1,298 +1,298 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/hide/user_options.svg b/sample/hide/user_options.svg index eef6f0049..aa9aa9ed2 100644 --- a/sample/hide/user_options.svg +++ b/sample/hide/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/hide/users.svg b/sample/hide/users.svg index ef4ca9cb3..15bc1fe4a 100644 --- a/sample/hide/users.svg +++ b/sample/hide/users.svg @@ -1,177 +1,177 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/hide_not_related_column/CamelizeTable.svg b/sample/hide_not_related_column/CamelizeTable.svg index b623a4d1a..d9ec3ff9f 100644 --- a/sample/hide_not_related_column/CamelizeTable.svg +++ b/sample/hide_not_related_column/CamelizeTable.svg @@ -1,23 +1,23 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - + + +CamelizeTable +     +[BASE TABLE] + diff --git a/sample/hide_not_related_column/comment_stars.svg b/sample/hide_not_related_column/comment_stars.svg index 4a2c5a434..ee3f2195c 100644 --- a/sample/hide_not_related_column/comment_stars.svg +++ b/sample/hide_not_related_column/comment_stars.svg @@ -1,104 +1,104 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -comment_post_id -[bigint] - -comment_user_id -[int] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +comment_post_id +[bigint] + +comment_user_id +[int] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] + + +users +     +[BASE TABLE] + +id +[int] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] + + +logs +     +[BASE TABLE] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/hide_not_related_column/comments.svg b/sample/hide_not_related_column/comments.svg index e49dc5cf8..79abf4d09 100644 --- a/sample/hide_not_related_column/comments.svg +++ b/sample/hide_not_related_column/comments.svg @@ -1,126 +1,126 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int] + + +users +     +[BASE TABLE] + +id +[int] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] + + +logs +     +[BASE TABLE] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -comment_post_id     -[bigint] - -comment_user_id     -[int] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +comment_post_id +[bigint] + +comment_user_id +[int] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/hide_not_related_column/hyphen-table.svg b/sample/hide_not_related_column/hyphen-table.svg index 3fcd409bf..366b33b81 100644 --- a/sample/hide_not_related_column/hyphen-table.svg +++ b/sample/hide_not_related_column/hyphen-table.svg @@ -1,23 +1,23 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - + + +hyphen-table +     +[BASE TABLE] + diff --git a/sample/hide_not_related_column/logs.svg b/sample/hide_not_related_column/logs.svg index 3da2decdf..9b6ba2d3b 100644 --- a/sample/hide_not_related_column/logs.svg +++ b/sample/hide_not_related_column/logs.svg @@ -1,126 +1,126 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - + + +logs +     +[BASE TABLE] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + users - - -users -     -[BASE TABLE] - -id     -[int] + + +users +     +[BASE TABLE] + +id +[int] logs:user_id->users:id - - -logs->users + + +logs->users posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -comment_post_id     -[bigint] - -comment_user_id     -[int] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +comment_post_id +[bigint] + +comment_user_id +[int] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/hide_not_related_column/long_long_long_long_long_long_long_long_table_name.svg b/sample/hide_not_related_column/long_long_long_long_long_long_long_long_table_name.svg index 777bfadba..04c196bb4 100644 --- a/sample/hide_not_related_column/long_long_long_long_long_long_long_long_table_name.svg +++ b/sample/hide_not_related_column/long_long_long_long_long_long_long_long_table_name.svg @@ -1,23 +1,23 @@ - - - + + long_long_long_long_long_long_long_long_table_name - + long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + diff --git a/sample/hide_not_related_column/post_comments.svg b/sample/hide_not_related_column/post_comments.svg index 807a08d41..e84c4db58 100644 --- a/sample/hide_not_related_column/post_comments.svg +++ b/sample/hide_not_related_column/post_comments.svg @@ -1,23 +1,23 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - + + +post_comments +     +[VIEW] + diff --git a/sample/hide_not_related_column/posts.svg b/sample/hide_not_related_column/posts.svg index d2b251eee..b45a033dd 100644 --- a/sample/hide_not_related_column/posts.svg +++ b/sample/hide_not_related_column/posts.svg @@ -1,101 +1,101 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + users - - -users -     -[BASE TABLE] - -id     -[int] + + +users +     +[BASE TABLE] + +id +[int] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) logs - - -logs -     -[BASE TABLE] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] + + +logs +     +[BASE TABLE] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/hide_not_related_column/schema.svg b/sample/hide_not_related_column/schema.svg index bdaa32aa9..590ef68b1 100644 --- a/sample/hide_not_related_column/schema.svg +++ b/sample/hide_not_related_column/schema.svg @@ -1,215 +1,215 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] + + +CamelizeTable +     +[BASE TABLE] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -comment_post_id     -[bigint] - -comment_user_id     -[int] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +comment_post_id +[bigint] + +comment_user_id +[int] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] + + +users +     +[BASE TABLE] + +id +[int] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] + + +hyphen-table +     +[BASE TABLE] logs - - -logs -     -[BASE TABLE] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] + + +logs +     +[BASE TABLE] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:user_id->users:id - - -logs->users + + +logs->users long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] post_comments - - -post_comments -     -[VIEW] + + +post_comments +     +[VIEW] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] + + +user_options +     +[BASE TABLE] + +user_id +[int] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/hide_not_related_column/user_options.svg b/sample/hide_not_related_column/user_options.svg index c4c60434a..5ee697101 100644 --- a/sample/hide_not_related_column/user_options.svg +++ b/sample/hide_not_related_column/user_options.svg @@ -1,45 +1,45 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + users - - -users -     -[BASE TABLE] - -id     -[int] + + +users +     +[BASE TABLE] + +id +[int] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/hide_not_related_column/users.svg b/sample/hide_not_related_column/users.svg index 6c44aa624..4435caf53 100644 --- a/sample/hide_not_related_column/users.svg +++ b/sample/hide_not_related_column/users.svg @@ -1,145 +1,145 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - + + +users +     +[BASE TABLE] + +id +[int] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -comment_post_id     -[bigint] - -comment_user_id     -[int] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +comment_post_id +[bigint] + +comment_user_id +[int] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] + + +user_options +     +[BASE TABLE] + +user_id +[int] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] + + +logs +     +[BASE TABLE] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] logs:user_id->users:id - - -logs->users + + +logs->users diff --git a/sample/mariadb/CamelizeTable.svg b/sample/mariadb/CamelizeTable.svg index 52ecd1a45..4094f7d80 100644 --- a/sample/mariadb/CamelizeTable.svg +++ b/sample/mariadb/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint(20)] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint(20)] + +created +[datetime] + diff --git a/sample/mariadb/comment_stars.svg b/sample/mariadb/comment_stars.svg index 006c6effe..e08a1766c 100644 --- a/sample/mariadb/comment_stars.svg +++ b/sample/mariadb/comment_stars.svg @@ -1,149 +1,149 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint(20)] - -user_id -[int(11)] - -comment_post_id -[bigint(20)] - -comment_user_id -[int(11)] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -post_id_desc     -[bigint(20)] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +post_id_desc +[bigint(20)] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mariadb/comments.svg b/sample/mariadb/comments.svg index e4605c35a..b4e5c5e43 100644 --- a/sample/mariadb/comments.svg +++ b/sample/mariadb/comments.svg @@ -1,186 +1,186 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint(20)] - -post_id -[bigint(20)] - -user_id -[int(11)] - -comment -[text] - -post_id_desc -[bigint(20)] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +post_id_desc +[bigint(20)] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/mariadb/hyphen-table.svg b/sample/mariadb/hyphen-table.svg index f6a5c5888..f8a056a9a 100644 --- a/sample/mariadb/hyphen-table.svg +++ b/sample/mariadb/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint(20)] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint(20)] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/mariadb/logs.svg b/sample/mariadb/logs.svg index 9a6b3de14..c755b4c8a 100644 --- a/sample/mariadb/logs.svg +++ b/sample/mariadb/logs.svg @@ -1,186 +1,186 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint(20)] - -user_id -[int(11)] - -post_id -[bigint(20)] - -comment_id -[bigint(20)] - -comment_star_id -[bigint(20)] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] logs:user_id->users:id - - -logs->users + + +logs->users posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -post_id_desc     -[bigint(20)] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +post_id_desc +[bigint(20)] + +created +[datetime] + +updated +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mariadb/post_comments.svg b/sample/mariadb/post_comments.svg index 2a1cb731b..00d7c563c 100644 --- a/sample/mariadb/post_comments.svg +++ b/sample/mariadb/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint(20)] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint(20)] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/mariadb/posts.svg b/sample/mariadb/posts.svg index 7822e6c53..60974f69c 100644 --- a/sample/mariadb/posts.svg +++ b/sample/mariadb/posts.svg @@ -1,152 +1,152 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint(20)] - -user_id -[int(11)] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -post_id_desc     -[bigint(20)] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +post_id_desc +[bigint(20)] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mariadb/same_name_constraints.svg b/sample/mariadb/same_name_constraints.svg index 703cac68c..1f214be23 100644 --- a/sample/mariadb/same_name_constraints.svg +++ b/sample/mariadb/same_name_constraints.svg @@ -1,63 +1,63 @@ - - - + + same_name_constraints - + same_name_constraints - - -same_name_constraints -     -[BASE TABLE] - -id -[bigint(20)] - -user_id -[int(11)] - + + +same_name_constraints +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] same_name_constraints:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/mariadb/schema.json b/sample/mariadb/schema.json index 0b49773dd..8334e3b18 100644 --- a/sample/mariadb/schema.json +++ b/sample/mariadb/schema.json @@ -1 +1 @@ -{"name":"testdb","desc":"Sample database document.","tables":[{"name":"CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"CamelizeTable","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `CamelizeTable` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `created` datetime NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"post_id","type":"bigint(20)","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"post_id_desc","type":"bigint(20)","nullable":true,"default":"NULL","extra_def":"GENERATED ALWAYS AS `post_id` * -1 VIRTUAL","comment":""},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""},{"name":"updated","type":"datetime","nullable":true,"default":"NULL","comment":""}],"indexes":[{"name":"comments_post_id_user_id_idx","def":"KEY comments_post_id_user_id_idx (post_id, user_id) USING BTREE","table":"comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_user_id_fk","def":"KEY comments_user_id_fk (user_id) USING BTREE","table":"comments","columns":["user_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"comments","columns":["id"],"comment":""},{"name":"post_id","def":"UNIQUE KEY post_id (post_id, user_id) USING BTREE","table":"comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts (id)","table":"comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"post_id","type":"UNIQUE","def":"UNIQUE KEY post_id (post_id, user_id)","table":"comments","referenced_table":null,"columns":["post_id","user_id"],"referenced_columns":null,"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comments","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `comments` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `post_id` bigint(20) NOT NULL,\n `user_id` int(11) NOT NULL,\n `comment` text NOT NULL COMMENT 'Comment\\nMulti-line\\r\\ncolumn\\rcomment',\n `post_id_desc` bigint(20) GENERATED ALWAYS AS (`post_id` * -1) VIRTUAL,\n `created` datetime NOT NULL,\n `updated` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `post_id` (`post_id`,`user_id`),\n KEY `comments_user_id_fk` (`user_id`),\n KEY `comments_post_id_user_id_idx` (`post_id`,`user_id`) USING HASH,\n CONSTRAINT `comments_post_id_fk` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`),\n CONSTRAINT `comments_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Comments\\nMulti-line\\r\\ntable\\rcomment'"},{"name":"comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint(20)","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp","nullable":false,"default":"current_timestamp()","extra_def":"on update current_timestamp()","comment":""},{"name":"updated","type":"timestamp","nullable":false,"default":"'0000-00-00 00:00:00'","comment":""}],"indexes":[{"name":"comment_stars_user_id_fk","def":"KEY comment_stars_user_id_fk (comment_user_id) USING BTREE","table":"comment_stars","columns":["comment_user_id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","def":"KEY comment_stars_user_id_post_id_fk (comment_post_id, comment_user_id) USING BTREE","table":"comment_stars","columns":["comment_post_id","comment_user_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"comment_stars","columns":["id"],"comment":""},{"name":"user_id","def":"UNIQUE KEY user_id (user_id, comment_post_id, comment_user_id) USING BTREE","table":"comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id)","table":"comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id)","table":"comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_user_id"],"referenced_columns":["post_id","user_id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comment_stars","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"user_id","type":"UNIQUE","def":"UNIQUE KEY user_id (user_id, comment_post_id, comment_user_id)","table":"comment_stars","referenced_table":null,"columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `comment_stars` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` int(11) NOT NULL,\n `comment_post_id` bigint(20) NOT NULL,\n `comment_user_id` int(11) NOT NULL,\n `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n PRIMARY KEY (`id`),\n UNIQUE KEY `user_id` (`user_id`,`comment_post_id`,`comment_user_id`),\n KEY `comment_stars_user_id_post_id_fk` (`comment_post_id`,`comment_user_id`),\n KEY `comment_stars_user_id_fk` (`comment_user_id`),\n CONSTRAINT `comment_stars_user_id_fk` FOREIGN KEY (`comment_user_id`) REFERENCES `users` (`id`),\n CONSTRAINT `comment_stars_user_id_post_id_fk` FOREIGN KEY (`comment_post_id`, `comment_user_id`) REFERENCES `comments` (`post_id`, `user_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"hyphen-table","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"hyphen-table","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `hyphen-table` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `hyphen-column` text NOT NULL,\n `created` datetime NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"logs","type":"BASE TABLE","comment":"Auditログ","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"comment_id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"comment_star_id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"payload","type":"text","nullable":true,"default":"NULL","comment":""},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"logs","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"logs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `logs` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` int(11) NOT NULL,\n `post_id` bigint(20) DEFAULT NULL,\n `comment_id` bigint(20) DEFAULT NULL,\n `comment_star_id` bigint(20) DEFAULT NULL,\n `payload` text DEFAULT NULL,\n `created` datetime NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Auditログ'"},{"name":"posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"enum('public','private','draft')","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""},{"name":"updated","type":"datetime","nullable":true,"default":"NULL","comment":""}],"indexes":[{"name":"posts_user_id_idx","def":"KEY posts_user_id_idx (id) USING BTREE","table":"posts","columns":["id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"posts","columns":["id"],"comment":""},{"name":"user_id","def":"UNIQUE KEY user_id (user_id, title) USING BTREE","table":"posts","columns":["user_id","title"],"comment":""}],"constraints":[{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"posts","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"user_id","type":"UNIQUE","def":"UNIQUE KEY user_id (user_id, title)","table":"posts","referenced_table":null,"columns":["user_id","title"],"referenced_columns":null,"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE TRIGGER update_posts_updated BEFORE UPDATE ON posts\nFOR EACH ROW\nSET NEW.updated = CURRENT_TIMESTAMP()","comment":""}],"def":"CREATE TABLE `posts` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` int(11) NOT NULL,\n `title` varchar(255) NOT NULL DEFAULT 'Untitled',\n `body` text NOT NULL,\n `post_type` enum('public','private','draft') NOT NULL COMMENT 'public/private/draft',\n `created` datetime NOT NULL,\n `updated` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `user_id` (`user_id`,`title`),\n KEY `posts_user_id_idx` (`id`) USING BTREE,\n CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Posts table'","labels":[{"Name":"green","Virtual":true},{"Name":"red","Virtual":true},{"Name":"blue","Virtual":true}]},{"name":"post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint(20)","nullable":true,"default":"0","comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'","comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"datetime","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"datetime","nullable":true,"default":"NULL","comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS ((select `c`.`id` AS `id`,`p`.`title` AS `title`,`u2`.`username` AS `post_user`,`c`.`comment` AS `comment`,`u2`.`username` AS `comment_user`,`c`.`created` AS `created`,`c`.`updated` AS `updated` from (((`testdb`.`posts` `p` left join `testdb`.`comments` `c` on(`p`.`id` = `c`.`post_id`)) left join `testdb`.`users` `u` on(`u`.`id` = `p`.`user_id`)) left join `testdb`.`users` `u2` on(`u2`.`id` = `c`.`user_id`))))","referenced_tables":["posts","comments","users"]},{"name":"same_name_constraints","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"same_name","def":"UNIQUE KEY same_name (user_id, id) USING BTREE","table":"same_name_constraints","columns":["user_id","id"],"comment":""}],"constraints":[{"name":"same_name","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"same_name_constraints","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"same_name","type":"UNIQUE","def":"UNIQUE KEY same_name (user_id, id)","table":"same_name_constraints","referenced_table":null,"columns":["user_id","id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `same_name_constraints` (\n `id` bigint(20) DEFAULT NULL,\n `user_id` int(11) NOT NULL,\n UNIQUE KEY `same_name` (`user_id`,`id`),\n CONSTRAINT `same_name` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"int(11)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":"","labels":[{"Name":"secure","Virtual":true},{"Name":"encrypted","Virtual":true}]},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com","labels":[{"Name":"secure","Virtual":true}]},{"name":"created","type":"timestamp","nullable":false,"default":"current_timestamp()","extra_def":"on update current_timestamp()","comment":""},{"name":"updated","type":"timestamp","nullable":false,"default":"'0000-00-00 00:00:00'","comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"users","columns":["id"],"comment":""},{"name":"email","def":"UNIQUE KEY email (email) USING BTREE","table":"users","columns":["email"],"comment":""},{"name":"username","def":"UNIQUE KEY username (username) USING BTREE","table":"users","columns":["username"],"comment":""}],"constraints":[{"name":"email","type":"UNIQUE","def":"UNIQUE KEY email (email)","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"username","type":"UNIQUE","def":"UNIQUE KEY username (username)","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `users` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `username` varchar(50) NOT NULL,\n `password` varchar(50) NOT NULL,\n `email` varchar(355) NOT NULL COMMENT 'ex. user@example.com',\n `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n PRIMARY KEY (`id`),\n UNIQUE KEY `username` (`username`),\n UNIQUE KEY `email` (`email`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Users table'"},{"name":"user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"tinyint(1)","nullable":false,"default":"0","comment":""},{"name":"created","type":"timestamp","nullable":false,"default":"current_timestamp()","extra_def":"on update current_timestamp()","comment":""},{"name":"updated","type":"timestamp","nullable":false,"default":"'0000-00-00 00:00:00'","comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (user_id) USING BTREE","table":"user_options","columns":["user_id"],"comment":""},{"name":"user_id","def":"UNIQUE KEY user_id (user_id) USING BTREE","table":"user_options","columns":["user_id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"user_id","type":"UNIQUE","def":"UNIQUE KEY user_id (user_id)","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":"CREATE TABLE `user_options` (\n `user_id` int(11) NOT NULL,\n `show_email` tinyint(1) NOT NULL DEFAULT 0,\n `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n PRIMARY KEY (`user_id`),\n UNIQUE KEY `user_id` (`user_id`),\n CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='User options table'"}],"relations":[{"table":"comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts (id)","virtual":false},{"table":"comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id)","virtual":false},{"table":"comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id)","virtual":false},{"table":"posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"same_name_constraints","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_star_id"],"cardinality":"Exactly one","parent_table":"comment_stars","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"Additional Relation","virtual":true}],"functions":[],"driver":{"name":"mariadb","database_version":"10.5.25-MariaDB-ubu2004","meta":{"dict":{"Functions":"Stored procedures and functions"}}},"labels":[{"Name":"sample","Virtual":true},{"Name":"tbls","Virtual":true}]} +{"name":"testdb","desc":"Sample database document.","tables":[{"name":"CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"CamelizeTable","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `CamelizeTable` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `created` datetime NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"post_id","type":"bigint(20)","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"post_id_desc","type":"bigint(20)","nullable":true,"default":"NULL","extra_def":"GENERATED ALWAYS AS `post_id` * -1 VIRTUAL","comment":""},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""},{"name":"updated","type":"datetime","nullable":true,"default":"NULL","comment":""}],"indexes":[{"name":"comments_post_id_user_id_idx","def":"KEY comments_post_id_user_id_idx (post_id, user_id) USING BTREE","table":"comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_user_id_fk","def":"KEY comments_user_id_fk (user_id) USING BTREE","table":"comments","columns":["user_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"comments","columns":["id"],"comment":""},{"name":"post_id","def":"UNIQUE KEY post_id (post_id, user_id) USING BTREE","table":"comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts (id)","table":"comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"post_id","type":"UNIQUE","def":"UNIQUE KEY post_id (post_id, user_id)","table":"comments","referenced_table":null,"columns":["post_id","user_id"],"referenced_columns":null,"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comments","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `comments` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `post_id` bigint(20) NOT NULL,\n `user_id` int(11) NOT NULL,\n `comment` text NOT NULL COMMENT 'Comment\\nMulti-line\\r\\ncolumn\\rcomment',\n `post_id_desc` bigint(20) GENERATED ALWAYS AS (`post_id` * -1) VIRTUAL,\n `created` datetime NOT NULL,\n `updated` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `post_id` (`post_id`,`user_id`),\n KEY `comments_user_id_fk` (`user_id`),\n KEY `comments_post_id_user_id_idx` (`post_id`,`user_id`) USING HASH,\n CONSTRAINT `comments_post_id_fk` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`),\n CONSTRAINT `comments_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Comments\\nMulti-line\\r\\ntable\\rcomment'"},{"name":"comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint(20)","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp","nullable":false,"default":"current_timestamp()","extra_def":"on update current_timestamp()","comment":""},{"name":"updated","type":"timestamp","nullable":false,"default":"'0000-00-00 00:00:00'","comment":""}],"indexes":[{"name":"comment_stars_user_id_fk","def":"KEY comment_stars_user_id_fk (comment_user_id) USING BTREE","table":"comment_stars","columns":["comment_user_id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","def":"KEY comment_stars_user_id_post_id_fk (comment_post_id, comment_user_id) USING BTREE","table":"comment_stars","columns":["comment_post_id","comment_user_id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"comment_stars","columns":["id"],"comment":""},{"name":"user_id","def":"UNIQUE KEY user_id (user_id, comment_post_id, comment_user_id) USING BTREE","table":"comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id)","table":"comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id)","table":"comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_user_id"],"referenced_columns":["post_id","user_id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comment_stars","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"user_id","type":"UNIQUE","def":"UNIQUE KEY user_id (user_id, comment_post_id, comment_user_id)","table":"comment_stars","referenced_table":null,"columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `comment_stars` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` int(11) NOT NULL,\n `comment_post_id` bigint(20) NOT NULL,\n `comment_user_id` int(11) NOT NULL,\n `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n PRIMARY KEY (`id`),\n UNIQUE KEY `user_id` (`user_id`,`comment_post_id`,`comment_user_id`),\n KEY `comment_stars_user_id_post_id_fk` (`comment_post_id`,`comment_user_id`),\n KEY `comment_stars_user_id_fk` (`comment_user_id`),\n CONSTRAINT `comment_stars_user_id_fk` FOREIGN KEY (`comment_user_id`) REFERENCES `users` (`id`),\n CONSTRAINT `comment_stars_user_id_post_id_fk` FOREIGN KEY (`comment_post_id`, `comment_user_id`) REFERENCES `comments` (`post_id`, `user_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"hyphen-table","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"hyphen-table","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `hyphen-table` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `hyphen-column` text NOT NULL,\n `created` datetime NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"logs","type":"BASE TABLE","comment":"Auditログ","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"comment_id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"comment_star_id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"payload","type":"text","nullable":true,"default":"NULL","comment":""},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"logs","columns":["id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"logs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `logs` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` int(11) NOT NULL,\n `post_id` bigint(20) DEFAULT NULL,\n `comment_id` bigint(20) DEFAULT NULL,\n `comment_star_id` bigint(20) DEFAULT NULL,\n `payload` text DEFAULT NULL,\n `created` datetime NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Auditログ'"},{"name":"posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint(20)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"enum('public','private','draft')","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"created","type":"datetime","nullable":false,"default":null,"comment":""},{"name":"updated","type":"datetime","nullable":true,"default":"NULL","comment":""}],"indexes":[{"name":"posts_user_id_idx","def":"KEY posts_user_id_idx (id) USING BTREE","table":"posts","columns":["id"],"comment":""},{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"posts","columns":["id"],"comment":""},{"name":"user_id","def":"UNIQUE KEY user_id (user_id, title) USING BTREE","table":"posts","columns":["user_id","title"],"comment":""}],"constraints":[{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"posts","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"user_id","type":"UNIQUE","def":"UNIQUE KEY user_id (user_id, title)","table":"posts","referenced_table":null,"columns":["user_id","title"],"referenced_columns":null,"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE TRIGGER update_posts_updated BEFORE UPDATE ON posts\nFOR EACH ROW\nSET NEW.updated = CURRENT_TIMESTAMP()","comment":""}],"def":"CREATE TABLE `posts` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` int(11) NOT NULL,\n `title` varchar(255) NOT NULL DEFAULT 'Untitled',\n `body` text NOT NULL,\n `post_type` enum('public','private','draft') NOT NULL COMMENT 'public/private/draft',\n `created` datetime NOT NULL,\n `updated` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `user_id` (`user_id`,`title`),\n KEY `posts_user_id_idx` (`id`) USING BTREE,\n CONSTRAINT `posts_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Posts table'","labels":[{"Name":"green","Virtual":true},{"Name":"red","Virtual":true},{"Name":"blue","Virtual":true}]},{"name":"post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint(20)","nullable":true,"default":"0","comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'","comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"datetime","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"datetime","nullable":true,"default":"NULL","comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS ((select `c`.`id` AS `id`,`p`.`title` AS `title`,`u2`.`username` AS `post_user`,`c`.`comment` AS `comment`,`u2`.`username` AS `comment_user`,`c`.`created` AS `created`,`c`.`updated` AS `updated` from (((`testdb`.`posts` `p` left join `testdb`.`comments` `c` on(`p`.`id` = `c`.`post_id`)) left join `testdb`.`users` `u` on(`u`.`id` = `p`.`user_id`)) left join `testdb`.`users` `u2` on(`u2`.`id` = `c`.`user_id`))))","referenced_tables":["posts","comments","users"]},{"name":"same_name_constraints","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"bigint(20)","nullable":true,"default":"NULL","comment":""},{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"same_name","def":"UNIQUE KEY same_name (user_id, id) USING BTREE","table":"same_name_constraints","columns":["user_id","id"],"comment":""}],"constraints":[{"name":"same_name","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"same_name_constraints","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"same_name","type":"UNIQUE","def":"UNIQUE KEY same_name (user_id, id)","table":"same_name_constraints","referenced_table":null,"columns":["user_id","id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `same_name_constraints` (\n `id` bigint(20) DEFAULT NULL,\n `user_id` int(11) NOT NULL,\n UNIQUE KEY `same_name` (`user_id`,`id`),\n CONSTRAINT `same_name` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci"},{"name":"users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"int(11)","nullable":false,"default":null,"comment":"","extra_def":"auto_increment"},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":"","labels":[{"Name":"secure","Virtual":true},{"Name":"encrypted","Virtual":true}]},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com","labels":[{"Name":"secure","Virtual":true}]},{"name":"created","type":"timestamp","nullable":false,"default":"current_timestamp()","extra_def":"on update current_timestamp()","comment":""},{"name":"updated","type":"timestamp","nullable":false,"default":"'0000-00-00 00:00:00'","comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (id) USING BTREE","table":"users","columns":["id"],"comment":""},{"name":"email","def":"UNIQUE KEY email (email) USING BTREE","table":"users","columns":["email"],"comment":""},{"name":"username","def":"UNIQUE KEY username (username) USING BTREE","table":"users","columns":["username"],"comment":""}],"constraints":[{"name":"email","type":"UNIQUE","def":"UNIQUE KEY email (email)","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""},{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"username","type":"UNIQUE","def":"UNIQUE KEY username (username)","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE `users` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `username` varchar(50) NOT NULL,\n `password` varchar(50) NOT NULL,\n `email` varchar(355) NOT NULL COMMENT 'ex. user@example.com',\n `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n PRIMARY KEY (`id`),\n UNIQUE KEY `username` (`username`),\n UNIQUE KEY `email` (`email`)\n) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Users table'"},{"name":"user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"int(11)","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"tinyint(1)","nullable":false,"default":"0","comment":""},{"name":"created","type":"timestamp","nullable":false,"default":"current_timestamp()","extra_def":"on update current_timestamp()","comment":""},{"name":"updated","type":"timestamp","nullable":false,"default":"'0000-00-00 00:00:00'","comment":""}],"indexes":[{"name":"PRIMARY","def":"PRIMARY KEY (user_id) USING BTREE","table":"user_options","columns":["user_id"],"comment":""},{"name":"user_id","def":"UNIQUE KEY user_id (user_id) USING BTREE","table":"user_options","columns":["user_id"],"comment":""}],"constraints":[{"name":"PRIMARY","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"user_id","type":"UNIQUE","def":"UNIQUE KEY user_id (user_id)","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id)","table":"user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":"CREATE TABLE `user_options` (\n `user_id` int(11) NOT NULL,\n `show_email` tinyint(1) NOT NULL DEFAULT 0,\n `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n PRIMARY KEY (`user_id`),\n UNIQUE KEY `user_id` (`user_id`),\n CONSTRAINT `user_options_user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='User options table'"}],"relations":[{"table":"comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts (id)","virtual":false},{"table":"comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id)","virtual":false},{"table":"comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id)","virtual":false},{"table":"posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"same_name_constraints","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id)","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_star_id"],"cardinality":"Exactly one","parent_table":"comment_stars","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"Additional Relation","virtual":true}],"functions":[],"driver":{"name":"mariadb","database_version":"10.5.26-MariaDB-ubu2004","meta":{"dict":{"Functions":"Stored procedures and functions"}}},"labels":[{"Name":"sample","Virtual":true},{"Name":"tbls","Virtual":true}]} diff --git a/sample/mariadb/schema.svg b/sample/mariadb/schema.svg index b8c4b1c76..bb675663e 100644 --- a/sample/mariadb/schema.svg +++ b/sample/mariadb/schema.svg @@ -1,333 +1,333 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint(20)] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint(20)] + +created +[datetime] comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -post_id_desc     -[bigint(20)] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +post_id_desc +[bigint(20)] + +created +[datetime] + +updated +[datetime] posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint(20)] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint(20)] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:user_id->users:id - - -logs->users + + +logs->users posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) post_comments - - -post_comments -     -[VIEW] - -id     -[bigint(20)] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint(20)] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] same_name_constraints - - -same_name_constraints -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] + + +same_name_constraints +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] same_name_constraints:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int(11)] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int(11)] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/mariadb/user_options.svg b/sample/mariadb/user_options.svg index fcba2a579..1717aed7c 100644 --- a/sample/mariadb/user_options.svg +++ b/sample/mariadb/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int(11)] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int(11)] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/mariadb/users.svg b/sample/mariadb/users.svg index d9ac10c13..0ed9db5dc 100644 --- a/sample/mariadb/users.svg +++ b/sample/mariadb/users.svg @@ -1,236 +1,236 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int(11)] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -post_id_desc     -[bigint(20)] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +post_id_desc +[bigint(20)] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) same_name_constraints - - -same_name_constraints -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] + + +same_name_constraints +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] same_name_constraints:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int(11)] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int(11)] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:user_id->users:id - - -logs->users + + +logs->users diff --git a/sample/mongo/schema.svg b/sample/mongo/schema.svg index 8bf4a7056..d73dc2f9a 100644 --- a/sample/mongo/schema.svg +++ b/sample/mongo/schema.svg @@ -1,42 +1,42 @@ - - - - + + + test.restaurants - - -test.restaurants -     -[collection] - -_id     -[objectId] - -address     -[document] - -borough     -[string] - -cuisine     -[string] - -grades     -[array] - -name     -[string] - -restaurant_id     -[string] + + +test.restaurants +     +[collection] + +_id +[objectId] + +address +[document] + +borough +[string] + +cuisine +[string] + +grades +[array] + +name +[string] + +restaurant_id +[string] diff --git a/sample/mongo/test.restaurants.svg b/sample/mongo/test.restaurants.svg index f865678e0..ec5a11114 100644 --- a/sample/mongo/test.restaurants.svg +++ b/sample/mongo/test.restaurants.svg @@ -1,44 +1,44 @@ - - - + + test.restaurants - + test.restaurants - - -test.restaurants -     -[collection] - -_id -[objectId] - -address -[document] - -borough -[string] - -cuisine -[string] - -grades -[array] - -name -[string] - -restaurant_id -[string] - + + +test.restaurants +     +[collection] + +_id +[objectId] + +address +[document] + +borough +[string] + +cuisine +[string] + +grades +[array] + +name +[string] + +restaurant_id +[string] + diff --git a/sample/mssql/CamelizeTable.svg b/sample/mssql/CamelizeTable.svg index e81d979a8..9c05aafdd 100644 --- a/sample/mssql/CamelizeTable.svg +++ b/sample/mssql/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASIC TABLE] - -id -[int] - -created -[date] - + + +CamelizeTable +     +[BASIC TABLE] + +id +[int] + +created +[date] + diff --git a/sample/mssql/Rabbits.Running.svg b/sample/mssql/Rabbits.Running.svg index 5fb794134..19f7c07b1 100644 --- a/sample/mssql/Rabbits.Running.svg +++ b/sample/mssql/Rabbits.Running.svg @@ -1,53 +1,53 @@ - - - + + Rabbits.Running - + Rabbits.Running - - -Rabbits.Running -     -[BASIC TABLE] - -LocationID -[int] - -ProductID -[int] - -EmployeeID -[int] - + + +Rabbits.Running +     +[BASIC TABLE] + +LocationID +[int] + +ProductID +[int] + +EmployeeID +[int] + Sales.Product - - -Sales.Product -     -[BASIC TABLE] - -ProductID     -[int] - -SalesPersonID     -[int] + + +Sales.Product +     +[BASIC TABLE] + +ProductID +[int] + +SalesPersonID +[int] Rabbits.Running:ProductID->Sales.Product:SalesPersonID - - + + diff --git a/sample/mssql/Sales.Product.svg b/sample/mssql/Sales.Product.svg index 87e79bad2..0a1979eea 100644 --- a/sample/mssql/Sales.Product.svg +++ b/sample/mssql/Sales.Product.svg @@ -1,53 +1,53 @@ - - - + + Sales.Product - + Sales.Product - - -Sales.Product -     -[BASIC TABLE] - -ProductID -[int] - -SalesPersonID -[int] - + + +Sales.Product +     +[BASIC TABLE] + +ProductID +[int] + +SalesPersonID +[int] + Rabbits.Running - - -Rabbits.Running -     -[BASIC TABLE] - -LocationID     -[int] - -ProductID     -[int] - -EmployeeID     -[int] + + +Rabbits.Running +     +[BASIC TABLE] + +LocationID +[int] + +ProductID +[int] + +EmployeeID +[int] Rabbits.Running:ProductID->Sales.Product:SalesPersonID - - + + diff --git a/sample/mssql/administrator.blogs.svg b/sample/mssql/administrator.blogs.svg index a5ae5cb3d..d8d97b9be 100644 --- a/sample/mssql/administrator.blogs.svg +++ b/sample/mssql/administrator.blogs.svg @@ -1,74 +1,74 @@ - - - + + administrator.blogs - + administrator.blogs - - -administrator.blogs -     -[BASIC TABLE] - -id -[int] - -user_id -[int] - -name -[text] - -description -[text] - -created -[date] - -updated -[date] - + + +administrator.blogs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +name +[text] + +description +[text] + +created +[date] + +updated +[date] + users - - -users -     -[BASIC TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[date] - -updated     -[date] + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] administrator.blogs:user_id->users:id - - + + diff --git a/sample/mssql/comment_stars.svg b/sample/mssql/comment_stars.svg index 7a6c2cd56..13a50ec8c 100644 --- a/sample/mssql/comment_stars.svg +++ b/sample/mssql/comment_stars.svg @@ -1,144 +1,144 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASIC TABLE] - -id -[int] - -user_id -[int] - -comment_post_id -[int] - -comment_user_id -[int] - -created -[date] - -updated -[date] - + + +comment_stars +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +comment_post_id +[int] + +comment_user_id +[int] + +created +[date] + +updated +[date] + comments - - -comments -     -[BASIC TABLE] - -id     -[int] - -post_id     -[int] - -user_id     -[int] - -comment     -[text] - -created     -[date] - -updated     -[date] + + +comments +     +[BASIC TABLE] + +id +[int] + +post_id +[int] + +user_id +[int] + +comment +[text] + +created +[date] + +updated +[date] comment_stars:comment_post_id->comments:post_id - - + + users - - -users -     -[BASIC TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[date] - -updated     -[date] + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] comment_stars:comment_user_id->users:id - - + + logs - - -logs -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -post_id     -[int] - -comment_id     -[int] - -comment_star_id     -[int] - -payload     -[text] - -created     -[date] + + +logs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +post_id +[int] + +comment_id +[int] + +comment_star_id +[int] + +payload +[text] + +created +[date] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mssql/comments.svg b/sample/mssql/comments.svg index 9adc0135e..5979eeaf6 100644 --- a/sample/mssql/comments.svg +++ b/sample/mssql/comments.svg @@ -1,177 +1,177 @@ - - - + + comments - + comments - - -comments -     -[BASIC TABLE] - -id -[int] - -post_id -[int] - -user_id -[int] - -comment -[text] - -created -[date] - -updated -[date] - + + +comments +     +[BASIC TABLE] + +id +[int] + +post_id +[int] + +user_id +[int] + +comment +[text] + +created +[date] + +updated +[date] + posts - - -posts -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -created     -[date] - -updated     -[date] + + +posts +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +created +[date] + +updated +[date] comments:post_id->posts:id - - + + users - - -users -     -[BASIC TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[date] - -updated     -[date] + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] comments:user_id->users:id - - + + logs - - -logs -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -post_id     -[int] - -comment_id     -[int] - -comment_star_id     -[int] - -payload     -[text] - -created     -[date] + + +logs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +post_id +[int] + +comment_id +[int] + +comment_star_id +[int] + +payload +[text] + +created +[date] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -comment_post_id     -[int] - -comment_user_id     -[int] - -created     -[date] - -updated     -[date] + + +comment_stars +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +comment_post_id +[int] + +comment_user_id +[int] + +created +[date] + +updated +[date] comment_stars:comment_post_id->comments:post_id - - + + diff --git a/sample/mssql/hyphen-table.svg b/sample/mssql/hyphen-table.svg index c69fbbf52..8e0062931 100644 --- a/sample/mssql/hyphen-table.svg +++ b/sample/mssql/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASIC TABLE] - -id -[int] - -hyphen-column -[text] - -created -[date] - + + +hyphen-table +     +[BASIC TABLE] + +id +[int] + +hyphen-column +[text] + +created +[date] + diff --git a/sample/mssql/logs.svg b/sample/mssql/logs.svg index aae666486..e94dc4bb9 100644 --- a/sample/mssql/logs.svg +++ b/sample/mssql/logs.svg @@ -1,180 +1,180 @@ - - - + + logs - + logs - - -logs -     -[BASIC TABLE] - -id -[int] - -user_id -[int] - -post_id -[int] - -comment_id -[int] - -comment_star_id -[int] - -payload -[text] - -created -[date] - + + +logs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +post_id +[int] + +comment_id +[int] + +comment_star_id +[int] + +payload +[text] + +created +[date] + users - - -users -     -[BASIC TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[date] - -updated     -[date] + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] logs:user_id->users:id - - -logs->users + + +logs->users posts - - -posts -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -created     -[date] - -updated     -[date] + + +posts +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +created +[date] + +updated +[date] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation comments - - -comments -     -[BASIC TABLE] - -id     -[int] - -post_id     -[int] - -user_id     -[int] - -comment     -[text] - -created     -[date] - -updated     -[date] + + +comments +     +[BASIC TABLE] + +id +[int] + +post_id +[int] + +user_id +[int] + +comment +[text] + +created +[date] + +updated +[date] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -comment_post_id     -[int] - -comment_user_id     -[int] - -created     -[date] - -updated     -[date] + + +comment_stars +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +comment_post_id +[int] + +comment_user_id +[int] + +created +[date] + +updated +[date] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mssql/name with spaces.svg b/sample/mssql/name with spaces.svg index 90dc2bed4..93bc1badd 100644 --- a/sample/mssql/name with spaces.svg +++ b/sample/mssql/name with spaces.svg @@ -1,26 +1,26 @@ - - - + + name with spaces - + name with spaces - - -name with spaces -     -[VIEW] - -title -[varchar(255)] - + + +name with spaces +     +[VIEW] + +title +[varchar(255)] + diff --git a/sample/mssql/post_comments.svg b/sample/mssql/post_comments.svg index b298dd657..e7877c1ef 100644 --- a/sample/mssql/post_comments.svg +++ b/sample/mssql/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[int] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[date] - -updated -[date] - + + +post_comments +     +[VIEW] + +id +[int] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[date] + +updated +[date] + diff --git a/sample/mssql/posts.svg b/sample/mssql/posts.svg index 67126375e..a57654a84 100644 --- a/sample/mssql/posts.svg +++ b/sample/mssql/posts.svg @@ -1,144 +1,144 @@ - - - + + posts - + posts - - -posts -     -[BASIC TABLE] - -id -[int] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -created -[date] - -updated -[date] - + + +posts +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +created +[date] + +updated +[date] + users - - -users -     -[BASIC TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[date] - -updated     -[date] + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] posts:user_id->users:id - - + + comments - - -comments -     -[BASIC TABLE] - -id     -[int] - -post_id     -[int] - -user_id     -[int] - -comment     -[text] - -created     -[date] - -updated     -[date] + + +comments +     +[BASIC TABLE] + +id +[int] + +post_id +[int] + +user_id +[int] + +comment +[text] + +created +[date] + +updated +[date] comments:post_id->posts:id - - + + logs - - -logs -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -post_id     -[int] - -comment_id     -[int] - -comment_star_id     -[int] - -payload     -[text] - -created     -[date] + + +logs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +post_id +[int] + +comment_id +[int] + +comment_star_id +[int] + +payload +[text] + +created +[date] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mssql/schema.json b/sample/mssql/schema.json index 3730dae26..95830edfd 100644 --- a/sample/mssql/schema.json +++ b/sample/mssql/schema.json @@ -1 +1 @@ -{"name":"testdb","desc":"Sample database document.","tables":[{"name":"users","type":"BASIC TABLE","comment":"Users table","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":"long long long long long long long long long long long long long long long long long long long long long description"},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__users_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"users","columns":["id"],"comment":""},{"name":"UQ__users_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ email ]","table":"users","columns":["email"],"comment":""},{"name":"UQ__users_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ username ]","table":"users","columns":["username"],"comment":""}],"constraints":[{"name":"PK__users_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"UQ__users_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ email ]","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""},{"name":"UQ__users_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ username ]","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""},{"name":"CK__users__username_*","type":"CHECK","def":"CHECK(len([username])\u003e(4))","table":"users","referenced_table":null,"columns":null,"referenced_columns":null,"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated\nON users\nAFTER UPDATE\nAS\nBEGIN\n UPDATE users SET updated = GETDATE()\n WHERE id = ( SELECT id FROM deleted)\nEND;","comment":""}],"def":""},{"name":"user_options","type":"BASIC TABLE","comment":"User options table","columns":[{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"bit","nullable":false,"default":"((0))","comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__user_opt_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ user_id ]","table":"user_options","columns":["user_id"],"comment":""}],"constraints":[{"name":"PK__user_opt_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ user_id ]","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE CASCADE","table":"user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":""},{"name":"posts","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":null,"comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"posts","columns":["id"],"comment":""},{"name":"UQ__posts_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, title ]","table":"posts","columns":["user_id","title"],"comment":""},{"name":"posts_user_id_idx","def":"NONCLUSTERED, [ user_id ]","table":"posts","columns":["user_id"],"comment":""}],"constraints":[{"name":"posts_id_pk","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"posts","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"UQ__posts_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, title ]","table":"posts","referenced_table":null,"columns":["user_id","title"],"referenced_columns":null,"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE CASCADE","table":"posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE TRIGGER update_posts_updated\nON posts\nAFTER UPDATE\nAS\nBEGIN\n UPDATE users SET updated = GETDATE()\n WHERE id = ( SELECT user_id FROM deleted)\nEND;","comment":""}],"def":"","labels":[{"Name":"green","Virtual":true},{"Name":"red","Virtual":true},{"Name":"blue","Virtual":true}]},{"name":"comments","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"comments","columns":["id"],"comment":""},{"name":"UQ__comments_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ post_id, user_id ]","table":"comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"NONCLUSTERED, [ post_id, user_id ]","table":"comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_id_pk","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"comments","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"UQ__comments_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ post_id, user_id ]","table":"comments","referenced_table":null,"columns":["post_id","user_id"],"referenced_columns":null,"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(post_id) REFERENCES posts(id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":""},{"name":"comment_stars","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"UQ__comment__*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, comment_post_id, comment_user_id ]","table":"comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"UQ__comment__*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, comment_post_id, comment_user_id ]","table":"comment_stars","referenced_table":null,"columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":null,"comment":""},{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(comment_user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_user_id"],"referenced_columns":["post_id","user_id"],"comment":""}],"triggers":[],"def":""},{"name":"logs","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"int","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":false,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"date","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"date","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id, p.title, u2.username AS post_user, c.comment, u2.username AS comment_user, c.created, c.updated\n FROM posts AS p\n LEFT JOIN comments AS c on p.id = c.post_id\n LEFT JOIN users AS u on u.id = p.user_id\n LEFT JOIN users AS u2 on u2.id = c.user_id\n);","referenced_tables":["posts","comments","users"]},{"name":"CamelizeTable","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"hyphen-table","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASIC TABLE","comment":"admin blogs","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__blogs_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"PK__blogs_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"administrator.blogs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":""},{"name":"name with spaces","type":"VIEW","comment":"","columns":[{"name":"title","type":"varchar(255)","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW \"name with spaces\" AS (\n SELECT TOP 1 p.title\n FROM posts AS p\n);","referenced_tables":["posts"]},{"name":"Sales.Product","type":"BASIC TABLE","comment":"","columns":[{"name":"ProductID","type":"int","nullable":false,"default":null,"comment":""},{"name":"SalesPersonID","type":"int","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__Product_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ ProductID ]","table":"Sales.Product","columns":["ProductID"],"comment":""},{"name":"UQ__Product_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ SalesPersonID ]","table":"Sales.Product","columns":["SalesPersonID"],"comment":""}],"constraints":[{"name":"PK__Product_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ ProductID ]","table":"Sales.Product","referenced_table":null,"columns":["ProductID"],"referenced_columns":null,"comment":""},{"name":"UQ__Product_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ SalesPersonID ]","table":"Sales.Product","referenced_table":null,"columns":["SalesPersonID"],"referenced_columns":null,"comment":""}],"triggers":[],"def":""},{"name":"Rabbits.Running","type":"BASIC TABLE","comment":"","columns":[{"name":"LocationID","type":"int","nullable":false,"default":null,"comment":""},{"name":"ProductID","type":"int","nullable":true,"default":null,"comment":""},{"name":"EmployeeID","type":"int","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__Running_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ LocationID ]","table":"Rabbits.Running","columns":["LocationID"],"comment":""},{"name":"UQ__Running_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ EmployeeID ]","table":"Rabbits.Running","columns":["EmployeeID"],"comment":""},{"name":"UQ__Running_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ ProductID ]","table":"Rabbits.Running","columns":["ProductID"],"comment":""}],"constraints":[{"name":"PK__Running_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ LocationID ]","table":"Rabbits.Running","referenced_table":null,"columns":["LocationID"],"referenced_columns":null,"comment":""},{"name":"UQ__Running_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ EmployeeID ]","table":"Rabbits.Running","referenced_table":null,"columns":["EmployeeID"],"referenced_columns":null,"comment":""},{"name":"UQ__Running_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ ProductID ]","table":"Rabbits.Running","referenced_table":null,"columns":["ProductID"],"referenced_columns":null,"comment":""},{"name":"FK_TempSales_SalesReason","type":"FOREIGN KEY","def":"FOREIGN KEY(ProductID) REFERENCES Sales.Product(SalesPersonID) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"Rabbits.Running","referenced_table":"Sales.Product","columns":["ProductID"],"referenced_columns":["SalesPersonID"],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"Rabbits.Running","columns":["ProductID"],"cardinality":"Zero or one","parent_table":"Sales.Product","parent_columns":["SalesPersonID"],"parent_cardinality":"Zero or one","def":"","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"dbo.get_user","return_type":"","arguments":"@userid int","type":"SQL inline table-valued function"},{"name":"dbo.What_DB_is_that","return_type":"","arguments":"@ID int","type":"SQL Stored Procedure"}],"driver":{"name":"sqlserver","database_version":"Microsoft SQL Server 2017 (RTM-CU31-GDR) (KB5029376) - 14.0.3465.1 (X64) \n\tJul 30 2023 15:31:58 \n\tCopyright (C) 2017 Microsoft Corporation\n\tDeveloper Edition (64-bit) on Linux (Ubuntu 18.04.6 LTS)","meta":{"dict":{"Functions":"Stored procedures and functions"}}},"labels":[{"Name":"sample","Virtual":true},{"Name":"tbls","Virtual":true}]} +{"name":"testdb","desc":"Sample database document.","tables":[{"name":"users","type":"BASIC TABLE","comment":"Users table","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":"long long long long long long long long long long long long long long long long long long long long long description"},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__users_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"users","columns":["id"],"comment":""},{"name":"UQ__users_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ email ]","table":"users","columns":["email"],"comment":""},{"name":"UQ__users_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ username ]","table":"users","columns":["username"],"comment":""}],"constraints":[{"name":"PK__users_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"UQ__users_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ email ]","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""},{"name":"UQ__users_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ username ]","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""},{"name":"CK__users__username_*","type":"CHECK","def":"CHECK(len([username])\u003e(4))","table":"users","referenced_table":null,"columns":null,"referenced_columns":null,"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated\nON users\nAFTER UPDATE\nAS\nBEGIN\n UPDATE users SET updated = GETDATE()\n WHERE id = ( SELECT id FROM deleted)\nEND;","comment":""}],"def":""},{"name":"user_options","type":"BASIC TABLE","comment":"User options table","columns":[{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"bit","nullable":false,"default":"((0))","comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__user_opt_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ user_id ]","table":"user_options","columns":["user_id"],"comment":""}],"constraints":[{"name":"PK__user_opt_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ user_id ]","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE CASCADE","table":"user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":""},{"name":"posts","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":null,"comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"posts","columns":["id"],"comment":""},{"name":"UQ__posts_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, title ]","table":"posts","columns":["user_id","title"],"comment":""},{"name":"posts_user_id_idx","def":"NONCLUSTERED, [ user_id ]","table":"posts","columns":["user_id"],"comment":""}],"constraints":[{"name":"posts_id_pk","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"posts","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"UQ__posts_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, title ]","table":"posts","referenced_table":null,"columns":["user_id","title"],"referenced_columns":null,"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE CASCADE","table":"posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE TRIGGER update_posts_updated\nON posts\nAFTER UPDATE\nAS\nBEGIN\n UPDATE users SET updated = GETDATE()\n WHERE id = ( SELECT user_id FROM deleted)\nEND;","comment":""}],"def":"","labels":[{"Name":"green","Virtual":true},{"Name":"red","Virtual":true},{"Name":"blue","Virtual":true}]},{"name":"comments","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"comments","columns":["id"],"comment":""},{"name":"UQ__comments_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ post_id, user_id ]","table":"comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"NONCLUSTERED, [ post_id, user_id ]","table":"comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_id_pk","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"comments","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"UQ__comments_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ post_id, user_id ]","table":"comments","referenced_table":null,"columns":["post_id","user_id"],"referenced_columns":null,"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(post_id) REFERENCES posts(id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":""},{"name":"comment_stars","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"UQ__comment__*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, comment_post_id, comment_user_id ]","table":"comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"UQ__comment__*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ user_id, comment_post_id, comment_user_id ]","table":"comment_stars","referenced_table":null,"columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":null,"comment":""},{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(comment_user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_user_id"],"referenced_columns":["post_id","user_id"],"comment":""}],"triggers":[],"def":""},{"name":"logs","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"int","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"int","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":false,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"date","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"date","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id, p.title, u2.username AS post_user, c.comment, u2.username AS comment_user, c.created, c.updated\n FROM posts AS p\n LEFT JOIN comments AS c on p.id = c.post_id\n LEFT JOIN users AS u on u.id = p.user_id\n LEFT JOIN users AS u2 on u2.id = c.user_id\n);","referenced_tables":["posts","comments","users"]},{"name":"CamelizeTable","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"hyphen-table","type":"BASIC TABLE","comment":"","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASIC TABLE","comment":"admin blogs","columns":[{"name":"id","type":"int","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"int","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"date","nullable":false,"default":null,"comment":""},{"name":"updated","type":"date","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__blogs_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"PK__blogs_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ id ]","table":"administrator.blogs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY(user_id) REFERENCES users(id) ON UPDATE NO_ACTION ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":""},{"name":"name with spaces","type":"VIEW","comment":"","columns":[{"name":"title","type":"varchar(255)","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW \"name with spaces\" AS (\n SELECT TOP 1 p.title\n FROM posts AS p\n);","referenced_tables":["posts"]},{"name":"Sales.Product","type":"BASIC TABLE","comment":"","columns":[{"name":"ProductID","type":"int","nullable":false,"default":null,"comment":""},{"name":"SalesPersonID","type":"int","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__Product_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ ProductID ]","table":"Sales.Product","columns":["ProductID"],"comment":""},{"name":"UQ__Product_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ SalesPersonID ]","table":"Sales.Product","columns":["SalesPersonID"],"comment":""}],"constraints":[{"name":"PK__Product_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ ProductID ]","table":"Sales.Product","referenced_table":null,"columns":["ProductID"],"referenced_columns":null,"comment":""},{"name":"UQ__Product_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ SalesPersonID ]","table":"Sales.Product","referenced_table":null,"columns":["SalesPersonID"],"referenced_columns":null,"comment":""}],"triggers":[],"def":""},{"name":"Rabbits.Running","type":"BASIC TABLE","comment":"","columns":[{"name":"LocationID","type":"int","nullable":false,"default":null,"comment":""},{"name":"ProductID","type":"int","nullable":true,"default":null,"comment":""},{"name":"EmployeeID","type":"int","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"PK__Running_*","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ LocationID ]","table":"Rabbits.Running","columns":["LocationID"],"comment":""},{"name":"UQ__Running_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ EmployeeID ]","table":"Rabbits.Running","columns":["EmployeeID"],"comment":""},{"name":"UQ__Running_*","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ ProductID ]","table":"Rabbits.Running","columns":["ProductID"],"comment":""}],"constraints":[{"name":"PK__Running_*","type":"PRIMARY KEY","def":"CLUSTERED, unique, part of a PRIMARY KEY constraint, [ LocationID ]","table":"Rabbits.Running","referenced_table":null,"columns":["LocationID"],"referenced_columns":null,"comment":""},{"name":"UQ__Running_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ EmployeeID ]","table":"Rabbits.Running","referenced_table":null,"columns":["EmployeeID"],"referenced_columns":null,"comment":""},{"name":"UQ__Running_*","type":"UNIQUE","def":"NONCLUSTERED, unique, part of a UNIQUE constraint, [ ProductID ]","table":"Rabbits.Running","referenced_table":null,"columns":["ProductID"],"referenced_columns":null,"comment":""},{"name":"FK_TempSales_SalesReason","type":"FOREIGN KEY","def":"FOREIGN KEY(ProductID) REFERENCES Sales.Product(SalesPersonID) ON UPDATE NO_ACTION ON DELETE NO_ACTION","table":"Rabbits.Running","referenced_table":"Sales.Product","columns":["ProductID"],"referenced_columns":["SalesPersonID"],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"","virtual":false},{"table":"Rabbits.Running","columns":["ProductID"],"cardinality":"Zero or one","parent_table":"Sales.Product","parent_columns":["SalesPersonID"],"parent_cardinality":"Zero or one","def":"","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"dbo.get_user","return_type":"","arguments":"@userid int","type":"SQL inline table-valued function"},{"name":"dbo.What_DB_is_that","return_type":"","arguments":"@ID int","type":"SQL Stored Procedure"}],"driver":{"name":"sqlserver","database_version":"Microsoft SQL Server 2019 (RTM-CU28-GDR) (KB5046060) - 15.0.4395.2 (X64) \n\tSep 24 2024 07:38:17 \n\tCopyright (C) 2019 Microsoft Corporation\n\tDeveloper Edition (64-bit) on Linux (Ubuntu 20.04.6 LTS) \u003cX64\u003e","meta":{"dict":{"Functions":"Stored procedures and functions"}}},"labels":[{"Name":"sample","Virtual":true},{"Name":"tbls","Virtual":true}]} diff --git a/sample/mssql/schema.svg b/sample/mssql/schema.svg index 00c04cf13..eb35782d4 100644 --- a/sample/mssql/schema.svg +++ b/sample/mssql/schema.svg @@ -1,383 +1,383 @@ - - - + + testdb - + users - - -users -     -[BASIC TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[date] - -updated     -[date] + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] user_options - - -user_options -     -[BASIC TABLE] - -user_id     -[int] - -show_email     -[bit] - -created     -[date] - -updated     -[date] + + +user_options +     +[BASIC TABLE] + +user_id +[int] + +show_email +[bit] + +created +[date] + +updated +[date] user_options:user_id->users:id - - + + posts - - -posts -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -created     -[date] - -updated     -[date] + + +posts +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +created +[date] + +updated +[date] posts:user_id->users:id - - + + comments - - -comments -     -[BASIC TABLE] - -id     -[int] - -post_id     -[int] - -user_id     -[int] - -comment     -[text] - -created     -[date] - -updated     -[date] + + +comments +     +[BASIC TABLE] + +id +[int] + +post_id +[int] + +user_id +[int] + +comment +[text] + +created +[date] + +updated +[date] comments:user_id->users:id - - + + comments:post_id->posts:id - - + + comment_stars - - -comment_stars -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -comment_post_id     -[int] - -comment_user_id     -[int] - -created     -[date] - -updated     -[date] + + +comment_stars +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +comment_post_id +[int] + +comment_user_id +[int] + +created +[date] + +updated +[date] comment_stars:comment_user_id->users:id - - + + comment_stars:comment_post_id->comments:post_id - - + + logs - - -logs -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -post_id     -[int] - -comment_id     -[int] - -comment_star_id     -[int] - -payload     -[text] - -created     -[date] + + +logs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +post_id +[int] + +comment_id +[int] + +comment_star_id +[int] + +payload +[text] + +created +[date] logs:user_id->users:id - - -logs->users + + +logs->users logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation post_comments - - -post_comments -     -[VIEW] - -id     -[int] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[date] - -updated     -[date] + + +post_comments +     +[VIEW] + +id +[int] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[date] + +updated +[date] CamelizeTable - - -CamelizeTable -     -[BASIC TABLE] - -id     -[int] - -created     -[date] + + +CamelizeTable +     +[BASIC TABLE] + +id +[int] + +created +[date] hyphen-table - - -hyphen-table -     -[BASIC TABLE] - -id     -[int] - -hyphen-column     -[text] - -created     -[date] + + +hyphen-table +     +[BASIC TABLE] + +id +[int] + +hyphen-column +[text] + +created +[date] administrator.blogs - - -administrator.blogs -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -name     -[text] - -description     -[text] - -created     -[date] - -updated     -[date] + + +administrator.blogs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +name +[text] + +description +[text] + +created +[date] + +updated +[date] administrator.blogs:user_id->users:id - - + + name with spaces - - -name with spaces -     -[VIEW] - -title     -[varchar(255)] + + +name with spaces +     +[VIEW] + +title +[varchar(255)] Sales.Product - - -Sales.Product -     -[BASIC TABLE] - -ProductID     -[int] - -SalesPersonID     -[int] + + +Sales.Product +     +[BASIC TABLE] + +ProductID +[int] + +SalesPersonID +[int] Rabbits.Running - - -Rabbits.Running -     -[BASIC TABLE] - -LocationID     -[int] - -ProductID     -[int] - -EmployeeID     -[int] + + +Rabbits.Running +     +[BASIC TABLE] + +LocationID +[int] + +ProductID +[int] + +EmployeeID +[int] Rabbits.Running:ProductID->Sales.Product:SalesPersonID - - + + diff --git a/sample/mssql/user_options.svg b/sample/mssql/user_options.svg index bfd24eb0f..0ef60940d 100644 --- a/sample/mssql/user_options.svg +++ b/sample/mssql/user_options.svg @@ -1,68 +1,68 @@ - - - + + user_options - + user_options - - -user_options -     -[BASIC TABLE] - -user_id -[int] - -show_email -[bit] - -created -[date] - -updated -[date] - + + +user_options +     +[BASIC TABLE] + +user_id +[int] + +show_email +[bit] + +created +[date] + +updated +[date] + users - - -users -     -[BASIC TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[date] - -updated     -[date] + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] user_options:user_id->users:id - - + + diff --git a/sample/mssql/users.svg b/sample/mssql/users.svg index ae23dd1de..8d49256dc 100644 --- a/sample/mssql/users.svg +++ b/sample/mssql/users.svg @@ -1,237 +1,237 @@ - - - + + users - + users - - -users -     -[BASIC TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[date] - -updated -[date] - + + +users +     +[BASIC TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[date] + +updated +[date] + user_options - - -user_options -     -[BASIC TABLE] - -user_id     -[int] - -show_email     -[bit] - -created     -[date] - -updated     -[date] + + +user_options +     +[BASIC TABLE] + +user_id +[int] + +show_email +[bit] + +created +[date] + +updated +[date] user_options:user_id->users:id - - + + posts - - -posts -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -created     -[date] - -updated     -[date] + + +posts +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +created +[date] + +updated +[date] posts:user_id->users:id - - + + comments - - -comments -     -[BASIC TABLE] - -id     -[int] - -post_id     -[int] - -user_id     -[int] - -comment     -[text] - -created     -[date] - -updated     -[date] + + +comments +     +[BASIC TABLE] + +id +[int] + +post_id +[int] + +user_id +[int] + +comment +[text] + +created +[date] + +updated +[date] comments:user_id->users:id - - + + comment_stars - - -comment_stars -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -comment_post_id     -[int] - -comment_user_id     -[int] - -created     -[date] - -updated     -[date] + + +comment_stars +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +comment_post_id +[int] + +comment_user_id +[int] + +created +[date] + +updated +[date] comment_stars:comment_user_id->users:id - - + + administrator.blogs - - -administrator.blogs -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -name     -[text] - -description     -[text] - -created     -[date] - -updated     -[date] + + +administrator.blogs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +name +[text] + +description +[text] + +created +[date] + +updated +[date] administrator.blogs:user_id->users:id - - + + logs - - -logs -     -[BASIC TABLE] - -id     -[int] - -user_id     -[int] - -post_id     -[int] - -comment_id     -[int] - -comment_star_id     -[int] - -payload     -[text] - -created     -[date] + + +logs +     +[BASIC TABLE] + +id +[int] + +user_id +[int] + +post_id +[int] + +comment_id +[int] + +comment_star_id +[int] + +payload +[text] + +created +[date] logs:user_id->users:id - - -logs->users + + +logs->users diff --git a/sample/mysql/CamelizeTable.svg b/sample/mysql/CamelizeTable.svg index d4a255f5c..a3a027ed8 100644 --- a/sample/mysql/CamelizeTable.svg +++ b/sample/mysql/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/mysql/comment_stars.svg b/sample/mysql/comment_stars.svg index ca64597b4..faa10dd22 100644 --- a/sample/mysql/comment_stars.svg +++ b/sample/mysql/comment_stars.svg @@ -1,149 +1,149 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mysql/comments.svg b/sample/mysql/comments.svg index 655a53931..7e22f797c 100644 --- a/sample/mysql/comments.svg +++ b/sample/mysql/comments.svg @@ -1,186 +1,186 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -post_id_desc -[bigint] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/mysql/hyphen-table.svg b/sample/mysql/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/mysql/hyphen-table.svg +++ b/sample/mysql/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/mysql/logs.svg b/sample/mysql/logs.svg index 6ea88a113..d2b9eb72a 100644 --- a/sample/mysql/logs.svg +++ b/sample/mysql/logs.svg @@ -1,186 +1,186 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] logs:user_id->users:id - - -logs->users + + +logs->users posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mysql/long_long_long_long_long_long_long_long_table_name.svg b/sample/mysql/long_long_long_long_long_long_long_long_table_name.svg index ae5169c4d..02e219e39 100644 --- a/sample/mysql/long_long_long_long_long_long_long_long_table_name.svg +++ b/sample/mysql/long_long_long_long_long_long_long_long_table_name.svg @@ -1,29 +1,29 @@ - - - + + long_long_long_long_long_long_long_long_table_name - + long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/mysql/post_comments.svg b/sample/mysql/post_comments.svg index 1d625b0da..e0fb69b9f 100644 --- a/sample/mysql/post_comments.svg +++ b/sample/mysql/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/mysql/posts.svg b/sample/mysql/posts.svg index fd047b403..dcf92d0e5 100644 --- a/sample/mysql/posts.svg +++ b/sample/mysql/posts.svg @@ -1,152 +1,152 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mysql/schema.svg b/sample/mysql/schema.svg index d02ec02ba..1c4b4e5a9 100644 --- a/sample/mysql/schema.svg +++ b/sample/mysql/schema.svg @@ -1,326 +1,326 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:user_id->users:id - - -logs->users + + +logs->users long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/mysql/user_options.svg b/sample/mysql/user_options.svg index eef6f0049..aa9aa9ed2 100644 --- a/sample/mysql/user_options.svg +++ b/sample/mysql/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/mysql/users.svg b/sample/mysql/users.svg index c2309a316..24f9d3e1b 100644 --- a/sample/mysql/users.svg +++ b/sample/mysql/users.svg @@ -1,214 +1,214 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:user_id->users:id - - -logs->users + + +logs->users diff --git a/sample/mysql56/CamelizeTable.svg b/sample/mysql56/CamelizeTable.svg index 52ecd1a45..4094f7d80 100644 --- a/sample/mysql56/CamelizeTable.svg +++ b/sample/mysql56/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint(20)] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint(20)] + +created +[datetime] + diff --git a/sample/mysql56/comment_stars.svg b/sample/mysql56/comment_stars.svg index 237d8c6c2..d629cb4f5 100644 --- a/sample/mysql56/comment_stars.svg +++ b/sample/mysql56/comment_stars.svg @@ -1,146 +1,146 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint(20)] - -user_id -[int(11)] - -comment_post_id -[bigint(20)] - -comment_user_id -[int(11)] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mysql56/comments.svg b/sample/mysql56/comments.svg index a042c7664..4232223c5 100644 --- a/sample/mysql56/comments.svg +++ b/sample/mysql56/comments.svg @@ -1,183 +1,183 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint(20)] - -post_id -[bigint(20)] - -user_id -[int(11)] - -comment -[text] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/mysql56/hyphen-table.svg b/sample/mysql56/hyphen-table.svg index f6a5c5888..f8a056a9a 100644 --- a/sample/mysql56/hyphen-table.svg +++ b/sample/mysql56/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint(20)] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint(20)] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/mysql56/logs.svg b/sample/mysql56/logs.svg index 868f387fb..536e6f450 100644 --- a/sample/mysql56/logs.svg +++ b/sample/mysql56/logs.svg @@ -1,183 +1,183 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint(20)] - -user_id -[int(11)] - -post_id -[bigint(20)] - -comment_id -[bigint(20)] - -comment_star_id -[bigint(20)] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] logs:user_id->users:id - - -logs->users + + +logs->users posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +created +[datetime] + +updated +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mysql56/post_comments.svg b/sample/mysql56/post_comments.svg index 2a1cb731b..00d7c563c 100644 --- a/sample/mysql56/post_comments.svg +++ b/sample/mysql56/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint(20)] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint(20)] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/mysql56/posts.svg b/sample/mysql56/posts.svg index 955243169..b00f77c19 100644 --- a/sample/mysql56/posts.svg +++ b/sample/mysql56/posts.svg @@ -1,149 +1,149 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint(20)] - -user_id -[int(11)] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/mysql56/schema.svg b/sample/mysql56/schema.svg index 54b0ffe5e..746a6c3bd 100644 --- a/sample/mysql56/schema.svg +++ b/sample/mysql56/schema.svg @@ -1,308 +1,308 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint(20)] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint(20)] + +created +[datetime] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint(20)] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint(20)] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:user_id->users:id - - -logs->users + + +logs->users post_comments - - -post_comments -     -[VIEW] - -id     -[bigint(20)] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint(20)] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int(11)] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int(11)] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/mysql56/user_options.svg b/sample/mysql56/user_options.svg index fcba2a579..1717aed7c 100644 --- a/sample/mysql56/user_options.svg +++ b/sample/mysql56/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int(11)] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int(11)] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int(11)] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/mysql56/users.svg b/sample/mysql56/users.svg index 9a4e5a5a1..e16e0848c 100644 --- a/sample/mysql56/users.svg +++ b/sample/mysql56/users.svg @@ -1,211 +1,211 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int(11)] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int(11)] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -comment_post_id     -[bigint(20)] - -comment_user_id     -[int(11)] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +comment_post_id +[bigint(20)] + +comment_user_id +[int(11)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint(20)] - -post_id     -[bigint(20)] - -user_id     -[int(11)] - -comment     -[text] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint(20)] + +post_id +[bigint(20)] + +user_id +[int(11)] + +comment +[text] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int(11)] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int(11)] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint(20)] - -user_id     -[int(11)] - -post_id     -[bigint(20)] - -comment_id     -[bigint(20)] - -comment_star_id     -[bigint(20)] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint(20)] + +user_id +[int(11)] + +post_id +[bigint(20)] + +comment_id +[bigint(20)] + +comment_star_id +[bigint(20)] + +payload +[text] + +created +[datetime] logs:user_id->users:id - - -logs->users + + +logs->users diff --git a/sample/number/CamelizeTable.svg b/sample/number/CamelizeTable.svg index d4a255f5c..a3a027ed8 100644 --- a/sample/number/CamelizeTable.svg +++ b/sample/number/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/number/comment_stars.svg b/sample/number/comment_stars.svg index 456c49224..841905fe9 100644 --- a/sample/number/comment_stars.svg +++ b/sample/number/comment_stars.svg @@ -1,112 +1,112 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) diff --git a/sample/number/comments.svg b/sample/number/comments.svg index e01945d35..838e8f573 100644 --- a/sample/number/comments.svg +++ b/sample/number/comments.svg @@ -1,149 +1,149 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -post_id_desc -[bigint] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/number/hyphen-table.svg b/sample/number/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/number/hyphen-table.svg +++ b/sample/number/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/number/logs.svg b/sample/number/logs.svg index a2a33c513..8357a9080 100644 --- a/sample/number/logs.svg +++ b/sample/number/logs.svg @@ -1,44 +1,44 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] + diff --git a/sample/number/long_long_long_long_long_long_long_long_table_name.svg b/sample/number/long_long_long_long_long_long_long_long_table_name.svg index ae5169c4d..02e219e39 100644 --- a/sample/number/long_long_long_long_long_long_long_long_table_name.svg +++ b/sample/number/long_long_long_long_long_long_long_long_table_name.svg @@ -1,29 +1,29 @@ - - - + + long_long_long_long_long_long_long_long_table_name - + long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/number/post_comments.svg b/sample/number/post_comments.svg index 1d625b0da..e0fb69b9f 100644 --- a/sample/number/post_comments.svg +++ b/sample/number/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/number/posts.svg b/sample/number/posts.svg index df99fdc67..9ed4f8a09 100644 --- a/sample/number/posts.svg +++ b/sample/number/posts.svg @@ -1,115 +1,115 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) diff --git a/sample/number/schema.svg b/sample/number/schema.svg index 4870e3d7f..e45f12e78 100644 --- a/sample/number/schema.svg +++ b/sample/number/schema.svg @@ -1,298 +1,298 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/number/user_options.svg b/sample/number/user_options.svg index eef6f0049..aa9aa9ed2 100644 --- a/sample/number/user_options.svg +++ b/sample/number/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/number/users.svg b/sample/number/users.svg index ef4ca9cb3..15bc1fe4a 100644 --- a/sample/number/users.svg +++ b/sample/number/users.svg @@ -1,177 +1,177 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/png/CamelizeTable.png b/sample/png/CamelizeTable.png index 19e3572f8..0c44b6fdb 100644 Binary files a/sample/png/CamelizeTable.png and b/sample/png/CamelizeTable.png differ diff --git a/sample/png/comment_stars.png b/sample/png/comment_stars.png index d3b760c64..defa7ac9f 100644 Binary files a/sample/png/comment_stars.png and b/sample/png/comment_stars.png differ diff --git a/sample/png/comments.png b/sample/png/comments.png index 165d9ac1b..fc5f91474 100644 Binary files a/sample/png/comments.png and b/sample/png/comments.png differ diff --git a/sample/png/hyphen-table.png b/sample/png/hyphen-table.png index 21328ee3d..477092aff 100644 Binary files a/sample/png/hyphen-table.png and b/sample/png/hyphen-table.png differ diff --git a/sample/png/logs.png b/sample/png/logs.png index 3fa9ae6d4..f61d3ea3d 100644 Binary files a/sample/png/logs.png and b/sample/png/logs.png differ diff --git a/sample/png/long_long_long_long_long_long_long_long_table_name.png b/sample/png/long_long_long_long_long_long_long_long_table_name.png index f48cb62d7..7b075910d 100644 Binary files a/sample/png/long_long_long_long_long_long_long_long_table_name.png and b/sample/png/long_long_long_long_long_long_long_long_table_name.png differ diff --git a/sample/png/post_comments.png b/sample/png/post_comments.png index d59bbf05a..a9db61ed4 100644 Binary files a/sample/png/post_comments.png and b/sample/png/post_comments.png differ diff --git a/sample/png/posts.png b/sample/png/posts.png index 9c88e9ada..fdd1779c4 100644 Binary files a/sample/png/posts.png and b/sample/png/posts.png differ diff --git a/sample/png/schema.png b/sample/png/schema.png index 85ef24289..07dad9787 100644 Binary files a/sample/png/schema.png and b/sample/png/schema.png differ diff --git a/sample/png/user_options.png b/sample/png/user_options.png index dd7aa5636..8b632be5c 100644 Binary files a/sample/png/user_options.png and b/sample/png/user_options.png differ diff --git a/sample/png/users.png b/sample/png/users.png index 582197f7e..cf52b228e 100644 Binary files a/sample/png/users.png and b/sample/png/users.png differ diff --git a/sample/postgres/administrator.blogs.svg b/sample/postgres/administrator.blogs.svg index 504935c34..1cc085333 100644 --- a/sample/postgres/administrator.blogs.svg +++ b/sample/postgres/administrator.blogs.svg @@ -1,75 +1,75 @@ - - - + + administrator.blogs - + administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id -[integer] - -user_id -[integer] - -name -[text] - -description -[text] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE diff --git a/sample/postgres/backup.blog_options.svg b/sample/postgres/backup.blog_options.svg index 858a77bc0..d5e609e6a 100644 --- a/sample/postgres/backup.blog_options.svg +++ b/sample/postgres/backup.blog_options.svg @@ -1,66 +1,66 @@ - - - + + backup.blog_options - + backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id -[integer] - -blog_id -[integer] - -label -[text] - -updated -[timestamp without time zone] - + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] + backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -dump     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE diff --git a/sample/postgres/backup.blogs.svg b/sample/postgres/backup.blogs.svg index 5a3cc1eae..4a1b0c757 100644 --- a/sample/postgres/backup.blogs.svg +++ b/sample/postgres/backup.blogs.svg @@ -1,66 +1,66 @@ - - - + + backup.blogs - + backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id -[integer] - -user_id -[integer] - -dump -[text] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id     -[integer] - -blog_id     -[integer] - -label     -[text] - -updated     -[timestamp without time zone] + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE diff --git a/sample/postgres/public.CamelizeTable.svg b/sample/postgres/public.CamelizeTable.svg index d3df00252..b7766351d 100644 --- a/sample/postgres/public.CamelizeTable.svg +++ b/sample/postgres/public.CamelizeTable.svg @@ -1,57 +1,57 @@ - - - + + public.CamelizeTable - + public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id -[uuid] - -created -[timestamp without time zone] - + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] + public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id     -[uuid] - -hyphen-column     -[text] - -CamelizeTableId     -[uuid] - -created     -[timestamp without time zone] + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE diff --git a/sample/postgres/public.comment_stars.svg b/sample/postgres/public.comment_stars.svg index 526c1cabb..e4216748e 100644 --- a/sample/postgres/public.comment_stars.svg +++ b/sample/postgres/public.comment_stars.svg @@ -1,149 +1,149 @@ - - - + + public.comment_stars - + public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id -[uuid] - -user_id -[integer] - -comment_post_id -[bigint] - -comment_user_id -[integer] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/postgres/public.comments.svg b/sample/postgres/public.comments.svg index dbdee89a5..076b3980f 100644 --- a/sample/postgres/public.comments.svg +++ b/sample/postgres/public.comments.svg @@ -1,189 +1,189 @@ - - - + + public.comments - + public.comments - - -public.comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[integer] - -comment -[text] - -post_id_desc -[bigint] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) diff --git a/sample/postgres/public.hyphen-table.svg b/sample/postgres/public.hyphen-table.svg index e4f01fe95..6620c6ea9 100644 --- a/sample/postgres/public.hyphen-table.svg +++ b/sample/postgres/public.hyphen-table.svg @@ -1,57 +1,57 @@ - - - + + public.hyphen-table - + public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id -[uuid] - -hyphen-column -[text] - -CamelizeTableId -[uuid] - -created -[timestamp without time zone] - + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] + public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id     -[uuid] - -created     -[timestamp without time zone] + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE diff --git a/sample/postgres/public.logs.svg b/sample/postgres/public.logs.svg index 752501d62..d19973136 100644 --- a/sample/postgres/public.logs.svg +++ b/sample/postgres/public.logs.svg @@ -1,189 +1,189 @@ - - - + + public.logs - + public.logs - - -public.logs -     -[BASE TABLE] - -id -[uuid] - -user_id -[integer] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[uuid] - -payload -[text] - -created -[timestamp without time zone] - + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/postgres/public.post_comment_stars.svg b/sample/postgres/public.post_comment_stars.svg index 6b49b909e..0abc5c4b6 100644 --- a/sample/postgres/public.post_comment_stars.svg +++ b/sample/postgres/public.post_comment_stars.svg @@ -1,38 +1,38 @@ - - - + + public.post_comment_stars - + public.post_comment_stars - - -public.post_comment_stars -     -[MATERIALIZED VIEW] - -id -[uuid] - -comment_user -[varchar(50)] - -comment_star_user -[varchar(50)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.post_comment_stars +     +[MATERIALIZED VIEW] + +id +[uuid] + +comment_user +[varchar(50)] + +comment_star_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + diff --git a/sample/postgres/public.post_comments.svg b/sample/postgres/public.post_comments.svg index 158094628..a351edf57 100644 --- a/sample/postgres/public.post_comments.svg +++ b/sample/postgres/public.post_comments.svg @@ -1,44 +1,44 @@ - - - + + public.post_comments - + public.post_comments - - -public.post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + diff --git a/sample/postgres/public.posts.svg b/sample/postgres/public.posts.svg index d738b7aae..2ffc7f650 100644 --- a/sample/postgres/public.posts.svg +++ b/sample/postgres/public.posts.svg @@ -1,155 +1,155 @@ - - - + + public.posts - + public.posts - - -public.posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[integer] - -title -[varchar(255)] - -body -[text] - -post_type -[post_types] - -labels -[varchar(50)[]] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/postgres/public.user_options.svg b/sample/postgres/public.user_options.svg index b7037a329..0a15c83e7 100644 --- a/sample/postgres/public.user_options.svg +++ b/sample/postgres/public.user_options.svg @@ -1,69 +1,69 @@ - - - + + public.user_options - + public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id -[integer] - -show_email -[boolean] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE diff --git a/sample/postgres/public.users.svg b/sample/postgres/public.users.svg index 34dccbf06..4eae1b9f9 100644 --- a/sample/postgres/public.users.svg +++ b/sample/postgres/public.users.svg @@ -1,251 +1,251 @@ - - - + + public.users - + public.users - - -public.users -     -[BASE TABLE] - -id -[integer] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id     -[integer] - -show_email     -[boolean] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -name     -[text] - -description     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users diff --git a/sample/postgres/schema.json b/sample/postgres/schema.json index 6b297dfa6..e3eebbbe5 100644 --- a/sample/postgres/schema.json +++ b/sample/postgres/schema.json @@ -1 +1 @@ -{"name":"testdb","desc":"Sample PostgreSQL database document.","tables":[{"name":"public.users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('users_id_seq'::regclass)","comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_pkey","def":"CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)","table":"public.users","columns":["id"],"comment":""},{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON public.users USING btree (username)","table":"public.users","columns":["username"],"comment":""},{"name":"users_email_key","def":"CREATE UNIQUE INDEX users_email_key ON public.users USING btree (email)","table":"public.users","columns":["email"],"comment":""}],"constraints":[{"name":"users_username_check","type":"CHECK","def":"CHECK ((char_length((username)::text) \u003e 4))","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.users","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"users_username_key","type":"UNIQUE","def":"UNIQUE (username)","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_email_key","type":"UNIQUE","def":"UNIQUE (email)","table":"public.users","referenced_table":"","columns":["email"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated AFTER INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when users insert or update"}],"def":""},{"name":"public.user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"boolean","nullable":false,"default":"false","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"user_options_pkey","def":"CREATE UNIQUE INDEX user_options_pkey ON public.user_options USING btree (user_id)","table":"public.user_options","columns":["user_id"],"comment":"PRIMARY KEY"}],"constraints":[{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"FK"},{"name":"user_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"public.user_options","referenced_table":"","columns":["user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('posts_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'::character varying","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"post_types","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"labels","type":"varchar(50)[]","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CREATE UNIQUE INDEX posts_id_pk ON public.posts USING btree (id)","table":"public.posts","columns":["id"],"comment":""},{"name":"posts_user_id_title_key","def":"CREATE UNIQUE INDEX posts_user_id_title_key ON public.posts USING btree (user_id, title)","table":"public.posts","columns":["title","user_id"],"comment":""},{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON public.posts USING btree (user_id)","table":"public.posts","columns":["user_id"],"comment":"posts.user_id index"}],"constraints":[{"name":"update_posts_updated","type":"TRIGGER","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","table":"public.posts","referenced_table":"","columns":["tableoid","cmax","xmax","cmin","xmin","ctid","id","user_id","title","body","post_type","labels","created","updated"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","table":"public.posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"posts -\u003e users"},{"name":"posts_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.posts","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_title_key","type":"UNIQUE","def":"UNIQUE (user_id, title)","table":"public.posts","referenced_table":"","columns":["user_id","title"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when posts update"}],"def":""},{"name":"public.comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('comments_id_seq'::regclass)","comment":""},{"name":"post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"post_id_desc","type":"bigint","nullable":true,"default":null,"comment":"","extra_def":"GENERATED ALWAYS AS (post_id * '-1'::integer) STORED"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CREATE UNIQUE INDEX comments_id_pk ON public.comments USING btree (id)","table":"public.comments","columns":["id"],"comment":""},{"name":"comments_post_id_user_id_key","def":"CREATE UNIQUE INDEX comments_post_id_user_id_key ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id)","table":"public.comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","table":"public.comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.comments","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"comments_post_id_user_id_key","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"public.comments","referenced_table":"","columns":["post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","def":"CREATE UNIQUE INDEX comment_stars_user_id_comment_post_id_comment_user_id_key ON public.comment_stars USING btree (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","columns":["comment_post_id","comment_user_id","user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","table":"public.comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","table":"public.comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_post_id","comment_user_id","comment_user_id"],"referenced_columns":["post_id","user_id","post_id","user_id"],"comment":""},{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","referenced_table":"","columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.logs","type":"BASE TABLE","comment":"audit log table","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"public.post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id,\n p.title,\n u.username AS post_user,\n c.comment,\n u2.username AS comment_user,\n c.created,\n c.updated\n FROM (((posts p\n LEFT JOIN comments c ON ((p.id = c.post_id)))\n LEFT JOIN users u ON ((u.id = p.user_id)))\n LEFT JOIN users u2 ON ((u2.id = c.user_id)))\n)","referenced_tables":["public.posts","public.comments","public.users"]},{"name":"public.post_comment_stars","type":"MATERIALIZED VIEW","comment":"","columns":[{"name":"id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"comment_star_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE MATERIALIZED VIEW post_comment_stars AS (\n SELECT cs.id,\n cu.username AS comment_user,\n csu.username AS comment_star_user,\n cs.created,\n cs.updated\n FROM (((comments c\n LEFT JOIN comment_stars cs ON (((cs.comment_post_id = c.id) AND (cs.comment_user_id = c.user_id))))\n LEFT JOIN users cu ON ((cu.id = cs.comment_user_id)))\n LEFT JOIN users csu ON ((csu.id = cs.user_id)))\n)","referenced_tables":["public.comments","public.comment_stars","public.users"]},{"name":"public.CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"CamelizeTable_id_key","def":"CREATE UNIQUE INDEX \"CamelizeTable_id_key\" ON public.\"CamelizeTable\" USING btree (id)","table":"public.CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"CamelizeTable_id_key","type":"UNIQUE","def":"UNIQUE (id)","table":"public.CamelizeTable","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"CamelizeTableId","type":"uuid","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphen-table_hyphen-column_key","def":"CREATE UNIQUE INDEX \"hyphen-table_hyphen-column_key\" ON public.\"hyphen-table\" USING btree (\"hyphen-column\")","table":"public.hyphen-table","columns":["hyphen-column"],"comment":""}],"constraints":[{"name":"hyphen-table_CamelizeTableId_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","table":"public.hyphen-table","referenced_table":"CamelizeTable","columns":["CamelizeTableId"],"referenced_columns":["id"],"comment":""},{"name":"hyphen-table_hyphen-column_key","type":"UNIQUE","def":"UNIQUE (\"hyphen-column\")","table":"public.hyphen-table","referenced_table":"","columns":["hyphen-column"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASE TABLE","comment":"admin blogs","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('administrator.blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON administrator.blogs USING btree (id)","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"administrator.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blogs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"dump","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON backup.blogs USING btree (id)","table":"backup.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blog_options","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blog_options_id_seq'::regclass)","comment":""},{"name":"blog_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"label","type":"text","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blog_options_pkey","def":"CREATE UNIQUE INDEX blog_options_pkey ON backup.blog_options USING btree (id)","table":"backup.blog_options","columns":["id"],"comment":""}],"constraints":[{"name":"blog_options_blog_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","table":"backup.blog_options","referenced_table":"blogs","columns":["blog_id"],"referenced_columns":["id"],"comment":""},{"name":"blog_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blog_options","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.bar","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"bar_pkey","def":"CREATE UNIQUE INDEX bar_pkey ON \"time\".bar USING btree (id)","table":"time.bar","columns":["id"],"comment":""}],"constraints":[{"name":"bar_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.bar","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.hyphenated-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphenated-table_pkey","def":"CREATE UNIQUE INDEX \"hyphenated-table_pkey\" ON \"time\".\"hyphenated-table\" USING btree (id)","table":"time.hyphenated-table","columns":["id"],"comment":""}],"constraints":[{"name":"hyphenated-table_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.hyphenated-table","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.referencing","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"bar_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"ht_id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"referencing_pkey","def":"CREATE UNIQUE INDEX referencing_pkey ON \"time\".referencing USING btree (id)","table":"time.referencing","columns":["id"],"comment":""}],"constraints":[{"name":"referencing_bar_id","type":"FOREIGN KEY","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","table":"time.referencing","referenced_table":"bar","columns":["bar_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_ht_id","type":"FOREIGN KEY","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","table":"time.referencing","referenced_table":"hyphenated-table","columns":["ht_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.referencing","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"public.user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","virtual":false},{"table":"public.comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id)","virtual":false},{"table":"public.comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","virtual":false},{"table":"public.hyphen-table","columns":["CamelizeTableId"],"cardinality":"Zero or more","parent_table":"public.CamelizeTable","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"backup.blog_options","columns":["blog_id"],"cardinality":"Zero or more","parent_table":"backup.blogs","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","virtual":false},{"table":"time.referencing","columns":["bar_id"],"cardinality":"Zero or more","parent_table":"time.bar","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","virtual":false},{"table":"time.referencing","columns":["ht_id"],"cardinality":"Zero or more","parent_table":"time.hyphenated-table","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","virtual":false},{"table":"public.logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"public.logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"public.comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"public.uuid_nil","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_dns","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_url","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_oid","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_x500","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1mc","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v3","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.uuid_generate_v4","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v5","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.update_updated","return_type":"trigger","arguments":"","type":"FUNCTION"},{"name":"public.reset_comment","return_type":"void","arguments":"IN comment_id integer","type":"PROCEDURE"}],"driver":{"name":"postgres","database_version":"PostgreSQL 15.7 (Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit","meta":{"current_schema":"public","search_paths":["\"$user\"","public","backup"],"dict":{"Functions":"Stored procedures and functions"}}}} +{"name":"testdb","desc":"Sample PostgreSQL database document.","tables":[{"name":"public.users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('users_id_seq'::regclass)","comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_pkey","def":"CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)","table":"public.users","columns":["id"],"comment":""},{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON public.users USING btree (username)","table":"public.users","columns":["username"],"comment":""},{"name":"users_email_key","def":"CREATE UNIQUE INDEX users_email_key ON public.users USING btree (email)","table":"public.users","columns":["email"],"comment":""}],"constraints":[{"name":"users_username_check","type":"CHECK","def":"CHECK ((char_length((username)::text) \u003e 4))","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.users","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"users_username_key","type":"UNIQUE","def":"UNIQUE (username)","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_email_key","type":"UNIQUE","def":"UNIQUE (email)","table":"public.users","referenced_table":"","columns":["email"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated AFTER INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when users insert or update"}],"def":""},{"name":"public.user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"boolean","nullable":false,"default":"false","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"user_options_pkey","def":"CREATE UNIQUE INDEX user_options_pkey ON public.user_options USING btree (user_id)","table":"public.user_options","columns":["user_id"],"comment":"PRIMARY KEY"}],"constraints":[{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"FK"},{"name":"user_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"public.user_options","referenced_table":"","columns":["user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('posts_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'::character varying","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"post_types","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"labels","type":"varchar(50)[]","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CREATE UNIQUE INDEX posts_id_pk ON public.posts USING btree (id)","table":"public.posts","columns":["id"],"comment":""},{"name":"posts_user_id_title_key","def":"CREATE UNIQUE INDEX posts_user_id_title_key ON public.posts USING btree (user_id, title)","table":"public.posts","columns":["user_id","title"],"comment":""},{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON public.posts USING btree (user_id)","table":"public.posts","columns":["user_id"],"comment":"posts.user_id index"}],"constraints":[{"name":"update_posts_updated","type":"TRIGGER","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","table":"public.posts","referenced_table":"","columns":["tableoid","cmax","xmax","cmin","xmin","ctid","id","user_id","title","body","post_type","labels","created","updated"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","table":"public.posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"posts -\u003e users"},{"name":"posts_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.posts","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_title_key","type":"UNIQUE","def":"UNIQUE (user_id, title)","table":"public.posts","referenced_table":"","columns":["user_id","title"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE FUNCTION update_updated()","comment":"Update updated when posts update"}],"def":""},{"name":"public.comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('comments_id_seq'::regclass)","comment":""},{"name":"post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"post_id_desc","type":"bigint","nullable":true,"default":null,"comment":"","extra_def":"GENERATED ALWAYS AS (post_id * '-1'::integer) STORED"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CREATE UNIQUE INDEX comments_id_pk ON public.comments USING btree (id)","table":"public.comments","columns":["id"],"comment":""},{"name":"comments_post_id_user_id_key","def":"CREATE UNIQUE INDEX comments_post_id_user_id_key ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id)","table":"public.comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","table":"public.comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.comments","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"comments_post_id_user_id_key","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"public.comments","referenced_table":"","columns":["post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","def":"CREATE UNIQUE INDEX comment_stars_user_id_comment_post_id_comment_user_id_key ON public.comment_stars USING btree (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","table":"public.comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","table":"public.comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_post_id","comment_user_id","comment_user_id"],"referenced_columns":["post_id","user_id","post_id","user_id"],"comment":""},{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","referenced_table":"","columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.logs","type":"BASE TABLE","comment":"audit log table","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"public.post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id,\n p.title,\n u.username AS post_user,\n c.comment,\n u2.username AS comment_user,\n c.created,\n c.updated\n FROM (((posts p\n LEFT JOIN comments c ON ((p.id = c.post_id)))\n LEFT JOIN users u ON ((u.id = p.user_id)))\n LEFT JOIN users u2 ON ((u2.id = c.user_id)))\n)","referenced_tables":["public.posts","public.comments","public.users"]},{"name":"public.post_comment_stars","type":"MATERIALIZED VIEW","comment":"","columns":[{"name":"id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"comment_star_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE MATERIALIZED VIEW post_comment_stars AS (\n SELECT cs.id,\n cu.username AS comment_user,\n csu.username AS comment_star_user,\n cs.created,\n cs.updated\n FROM (((comments c\n LEFT JOIN comment_stars cs ON (((cs.comment_post_id = c.id) AND (cs.comment_user_id = c.user_id))))\n LEFT JOIN users cu ON ((cu.id = cs.comment_user_id)))\n LEFT JOIN users csu ON ((csu.id = cs.user_id)))\n)","referenced_tables":["public.comments","public.comment_stars","public.users"]},{"name":"public.CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"CamelizeTable_id_key","def":"CREATE UNIQUE INDEX \"CamelizeTable_id_key\" ON public.\"CamelizeTable\" USING btree (id)","table":"public.CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"CamelizeTable_id_key","type":"UNIQUE","def":"UNIQUE (id)","table":"public.CamelizeTable","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"CamelizeTableId","type":"uuid","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphen-table_hyphen-column_key","def":"CREATE UNIQUE INDEX \"hyphen-table_hyphen-column_key\" ON public.\"hyphen-table\" USING btree (\"hyphen-column\")","table":"public.hyphen-table","columns":["hyphen-column"],"comment":""}],"constraints":[{"name":"hyphen-table_CamelizeTableId_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","table":"public.hyphen-table","referenced_table":"CamelizeTable","columns":["CamelizeTableId"],"referenced_columns":["id"],"comment":""},{"name":"hyphen-table_hyphen-column_key","type":"UNIQUE","def":"UNIQUE (\"hyphen-column\")","table":"public.hyphen-table","referenced_table":"","columns":["hyphen-column"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASE TABLE","comment":"admin blogs","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('administrator.blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON administrator.blogs USING btree (id)","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"administrator.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blogs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"dump","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON backup.blogs USING btree (id)","table":"backup.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blog_options","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blog_options_id_seq'::regclass)","comment":""},{"name":"blog_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"label","type":"text","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blog_options_pkey","def":"CREATE UNIQUE INDEX blog_options_pkey ON backup.blog_options USING btree (id)","table":"backup.blog_options","columns":["id"],"comment":""}],"constraints":[{"name":"blog_options_blog_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","table":"backup.blog_options","referenced_table":"blogs","columns":["blog_id"],"referenced_columns":["id"],"comment":""},{"name":"blog_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blog_options","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.bar","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"bar_pkey","def":"CREATE UNIQUE INDEX bar_pkey ON \"time\".bar USING btree (id)","table":"time.bar","columns":["id"],"comment":""}],"constraints":[{"name":"bar_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.bar","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.hyphenated-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphenated-table_pkey","def":"CREATE UNIQUE INDEX \"hyphenated-table_pkey\" ON \"time\".\"hyphenated-table\" USING btree (id)","table":"time.hyphenated-table","columns":["id"],"comment":""}],"constraints":[{"name":"hyphenated-table_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.hyphenated-table","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.referencing","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"bar_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"ht_id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"referencing_pkey","def":"CREATE UNIQUE INDEX referencing_pkey ON \"time\".referencing USING btree (id)","table":"time.referencing","columns":["id"],"comment":""}],"constraints":[{"name":"referencing_bar_id","type":"FOREIGN KEY","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","table":"time.referencing","referenced_table":"bar","columns":["bar_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_ht_id","type":"FOREIGN KEY","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","table":"time.referencing","referenced_table":"hyphenated-table","columns":["ht_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.referencing","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"public.user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id)","virtual":false},{"table":"public.comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id)","virtual":false},{"table":"public.comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","virtual":false},{"table":"public.hyphen-table","columns":["CamelizeTableId"],"cardinality":"Zero or more","parent_table":"public.CamelizeTable","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"backup.blog_options","columns":["blog_id"],"cardinality":"Zero or more","parent_table":"backup.blogs","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","virtual":false},{"table":"time.referencing","columns":["bar_id"],"cardinality":"Zero or more","parent_table":"time.bar","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","virtual":false},{"table":"time.referencing","columns":["ht_id"],"cardinality":"Zero or more","parent_table":"time.hyphenated-table","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","virtual":false},{"table":"public.logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"public.logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"public.comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"public.uuid_nil","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_dns","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_url","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_oid","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_x500","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1mc","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v3","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.uuid_generate_v4","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v5","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.update_updated","return_type":"trigger","arguments":"","type":"FUNCTION"},{"name":"public.reset_comment","return_type":"void","arguments":"IN comment_id integer","type":"PROCEDURE"}],"enums":[{"name":"public.post_types","values":["draft","private","public"]}],"driver":{"name":"postgres","database_version":"PostgreSQL 15.8 (Debian 15.8-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit","meta":{"current_schema":"public","search_paths":["postgres","public","backup"],"dict":{"Functions":"Stored procedures and functions"}}}} diff --git a/sample/postgres/schema.svg b/sample/postgres/schema.svg index d37bbb43a..9bb4f9ddb 100644 --- a/sample/postgres/schema.svg +++ b/sample/postgres/schema.svg @@ -1,490 +1,490 @@ - - - + + testdb - + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id     -[integer] - -show_email     -[boolean] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL (user_id) public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +post_id_desc +[bigint] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation public.post_comments - - -public.post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.post_comment_stars - - -public.post_comment_stars -     -[MATERIALIZED VIEW] - -id     -[uuid] - -comment_user     -[varchar(50)] - -comment_star_user     -[varchar(50)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.post_comment_stars +     +[MATERIALIZED VIEW] + +id +[uuid] + +comment_user +[varchar(50)] + +comment_star_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id     -[uuid] - -created     -[timestamp without time zone] + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id     -[uuid] - -hyphen-column     -[text] - -CamelizeTableId     -[uuid] - -created     -[timestamp without time zone] + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -name     -[text] - -description     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -dump     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id     -[integer] - -blog_id     -[integer] - -label     -[text] - -updated     -[timestamp without time zone] + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE time.bar - - -time.bar -     -[BASE TABLE] - -id     -[integer] + + +time.bar +     +[BASE TABLE] + +id +[integer] time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id     -[integer] + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/postgres/time.bar.svg b/sample/postgres/time.bar.svg index 414a70543..4689ff73b 100644 --- a/sample/postgres/time.bar.svg +++ b/sample/postgres/time.bar.svg @@ -1,51 +1,51 @@ - - - + + time.bar - + time.bar - - -time.bar -     -[BASE TABLE] - -id -[integer] - + + +time.bar +     +[BASE TABLE] + +id +[integer] + time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) diff --git a/sample/postgres/time.hyphenated-table.svg b/sample/postgres/time.hyphenated-table.svg index a4f994d60..4b639940f 100644 --- a/sample/postgres/time.hyphenated-table.svg +++ b/sample/postgres/time.hyphenated-table.svg @@ -1,51 +1,51 @@ - - - + + time.hyphenated-table - + time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id -[integer] - + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] + time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/postgres/time.referencing.svg b/sample/postgres/time.referencing.svg index b224b74c2..e85bb6a69 100644 --- a/sample/postgres/time.referencing.svg +++ b/sample/postgres/time.referencing.svg @@ -1,70 +1,70 @@ - - - + + time.referencing - + time.referencing - - -time.referencing -     -[BASE TABLE] - -id -[integer] - -bar_id -[integer] - -ht_id -[integer] - + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] + time.bar - - -time.bar -     -[BASE TABLE] - -id     -[integer] + + +time.bar +     +[BASE TABLE] + +id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id     -[integer] + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/postgres95/administrator.blogs.svg b/sample/postgres95/administrator.blogs.svg index 504935c34..1cc085333 100644 --- a/sample/postgres95/administrator.blogs.svg +++ b/sample/postgres95/administrator.blogs.svg @@ -1,75 +1,75 @@ - - - + + administrator.blogs - + administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id -[integer] - -user_id -[integer] - -name -[text] - -description -[text] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE diff --git a/sample/postgres95/backup.blog_options.svg b/sample/postgres95/backup.blog_options.svg index 858a77bc0..d5e609e6a 100644 --- a/sample/postgres95/backup.blog_options.svg +++ b/sample/postgres95/backup.blog_options.svg @@ -1,66 +1,66 @@ - - - + + backup.blog_options - + backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id -[integer] - -blog_id -[integer] - -label -[text] - -updated -[timestamp without time zone] - + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] + backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -dump     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE diff --git a/sample/postgres95/backup.blogs.svg b/sample/postgres95/backup.blogs.svg index 5a3cc1eae..4a1b0c757 100644 --- a/sample/postgres95/backup.blogs.svg +++ b/sample/postgres95/backup.blogs.svg @@ -1,66 +1,66 @@ - - - + + backup.blogs - + backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id -[integer] - -user_id -[integer] - -dump -[text] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id     -[integer] - -blog_id     -[integer] - -label     -[text] - -updated     -[timestamp without time zone] + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE diff --git a/sample/postgres95/public.CamelizeTable.svg b/sample/postgres95/public.CamelizeTable.svg index d3df00252..b7766351d 100644 --- a/sample/postgres95/public.CamelizeTable.svg +++ b/sample/postgres95/public.CamelizeTable.svg @@ -1,57 +1,57 @@ - - - + + public.CamelizeTable - + public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id -[uuid] - -created -[timestamp without time zone] - + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] + public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id     -[uuid] - -hyphen-column     -[text] - -CamelizeTableId     -[uuid] - -created     -[timestamp without time zone] + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE diff --git a/sample/postgres95/public.comment_stars.svg b/sample/postgres95/public.comment_stars.svg index 366eb728d..ecaffadb5 100644 --- a/sample/postgres95/public.comment_stars.svg +++ b/sample/postgres95/public.comment_stars.svg @@ -1,146 +1,146 @@ - - - + + public.comment_stars - + public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id -[uuid] - -user_id -[integer] - -comment_post_id -[bigint] - -comment_user_id -[integer] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/postgres95/public.comments.svg b/sample/postgres95/public.comments.svg index a0c72feae..725dfb24a 100644 --- a/sample/postgres95/public.comments.svg +++ b/sample/postgres95/public.comments.svg @@ -1,186 +1,186 @@ - - - + + public.comments - + public.comments - - -public.comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[integer] - -comment -[text] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) diff --git a/sample/postgres95/public.hyphen-table.svg b/sample/postgres95/public.hyphen-table.svg index e4f01fe95..6620c6ea9 100644 --- a/sample/postgres95/public.hyphen-table.svg +++ b/sample/postgres95/public.hyphen-table.svg @@ -1,57 +1,57 @@ - - - + + public.hyphen-table - + public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id -[uuid] - -hyphen-column -[text] - -CamelizeTableId -[uuid] - -created -[timestamp without time zone] - + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] + public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id     -[uuid] - -created     -[timestamp without time zone] + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE diff --git a/sample/postgres95/public.logs.svg b/sample/postgres95/public.logs.svg index d4a7f3cbe..c5caa1afb 100644 --- a/sample/postgres95/public.logs.svg +++ b/sample/postgres95/public.logs.svg @@ -1,186 +1,186 @@ - - - + + public.logs - + public.logs - - -public.logs -     -[BASE TABLE] - -id -[uuid] - -user_id -[integer] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[uuid] - -payload -[text] - -created -[timestamp without time zone] - + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/postgres95/public.post_comment_stars.svg b/sample/postgres95/public.post_comment_stars.svg index 6b49b909e..0abc5c4b6 100644 --- a/sample/postgres95/public.post_comment_stars.svg +++ b/sample/postgres95/public.post_comment_stars.svg @@ -1,38 +1,38 @@ - - - + + public.post_comment_stars - + public.post_comment_stars - - -public.post_comment_stars -     -[MATERIALIZED VIEW] - -id -[uuid] - -comment_user -[varchar(50)] - -comment_star_user -[varchar(50)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.post_comment_stars +     +[MATERIALIZED VIEW] + +id +[uuid] + +comment_user +[varchar(50)] + +comment_star_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + diff --git a/sample/postgres95/public.post_comments.svg b/sample/postgres95/public.post_comments.svg index 158094628..a351edf57 100644 --- a/sample/postgres95/public.post_comments.svg +++ b/sample/postgres95/public.post_comments.svg @@ -1,44 +1,44 @@ - - - + + public.post_comments - + public.post_comments - - -public.post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + diff --git a/sample/postgres95/public.posts.svg b/sample/postgres95/public.posts.svg index 4908231da..9badab54e 100644 --- a/sample/postgres95/public.posts.svg +++ b/sample/postgres95/public.posts.svg @@ -1,152 +1,152 @@ - - - + + public.posts - + public.posts - - -public.posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[integer] - -title -[varchar(255)] - -body -[text] - -post_type -[post_types] - -labels -[varchar(50)[]] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/postgres95/public.user_options.svg b/sample/postgres95/public.user_options.svg index b7037a329..0a15c83e7 100644 --- a/sample/postgres95/public.user_options.svg +++ b/sample/postgres95/public.user_options.svg @@ -1,69 +1,69 @@ - - - + + public.user_options - + public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id -[integer] - -show_email -[boolean] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE diff --git a/sample/postgres95/public.users.svg b/sample/postgres95/public.users.svg index 02aab391c..1049a13f6 100644 --- a/sample/postgres95/public.users.svg +++ b/sample/postgres95/public.users.svg @@ -1,248 +1,248 @@ - - - + + public.users - + public.users - - -public.users -     -[BASE TABLE] - -id -[integer] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp without time zone] - -updated -[timestamp without time zone] - + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] + public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id     -[integer] - -show_email     -[boolean] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -name     -[text] - -description     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users diff --git a/sample/postgres95/schema.json b/sample/postgres95/schema.json index 68764a3c0..446ec9c6e 100644 --- a/sample/postgres95/schema.json +++ b/sample/postgres95/schema.json @@ -1 +1 @@ -{"name":"testdb","desc":"Sample PostgreSQL database document.","tables":[{"name":"public.users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('users_id_seq'::regclass)","comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_pkey","def":"CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)","table":"public.users","columns":["id"],"comment":""},{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON public.users USING btree (username)","table":"public.users","columns":["username"],"comment":""},{"name":"users_email_key","def":"CREATE UNIQUE INDEX users_email_key ON public.users USING btree (email)","table":"public.users","columns":["email"],"comment":""}],"constraints":[{"name":"users_username_check","type":"CHECK","def":"CHECK ((char_length((username)::text) \u003e 4))","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.users","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"users_username_key","type":"UNIQUE","def":"UNIQUE (username)","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_email_key","type":"UNIQUE","def":"UNIQUE (email)","table":"public.users","referenced_table":"","columns":["email"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated AFTER INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE PROCEDURE update_updated()","comment":"Update updated when users insert or update"}],"def":""},{"name":"public.user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"boolean","nullable":false,"default":"false","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"user_options_pkey","def":"CREATE UNIQUE INDEX user_options_pkey ON public.user_options USING btree (user_id)","table":"public.user_options","columns":["user_id"],"comment":"PRIMARY KEY"}],"constraints":[{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"FK"},{"name":"user_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"public.user_options","referenced_table":"","columns":["user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('posts_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'::character varying","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"post_types","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"labels","type":"varchar(50)[]","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CREATE UNIQUE INDEX posts_id_pk ON public.posts USING btree (id)","table":"public.posts","columns":["id"],"comment":""},{"name":"posts_user_id_title_key","def":"CREATE UNIQUE INDEX posts_user_id_title_key ON public.posts USING btree (user_id, title)","table":"public.posts","columns":["title","user_id"],"comment":""},{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON public.posts USING btree (user_id)","table":"public.posts","columns":["user_id"],"comment":"posts.user_id index"}],"constraints":[{"name":"update_posts_updated","type":"TRIGGER","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE update_updated()","table":"public.posts","referenced_table":"","columns":["updated","body","post_type","labels","created","tableoid","cmax","xmax","cmin","xmin","ctid","id","user_id","title"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"posts -\u003e users"},{"name":"posts_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.posts","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_title_key","type":"UNIQUE","def":"UNIQUE (user_id, title)","table":"public.posts","referenced_table":"","columns":["user_id","title"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE update_updated()","comment":"Update updated when posts update"}],"def":""},{"name":"public.comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('comments_id_seq'::regclass)","comment":""},{"name":"post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CREATE UNIQUE INDEX comments_id_pk ON public.comments USING btree (id)","table":"public.comments","columns":["id"],"comment":""},{"name":"comments_post_id_user_id_key","def":"CREATE UNIQUE INDEX comments_post_id_user_id_key ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id)","table":"public.comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","table":"public.comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.comments","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"comments_post_id_user_id_key","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"public.comments","referenced_table":"","columns":["post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","def":"CREATE UNIQUE INDEX comment_stars_user_id_comment_post_id_comment_user_id_key ON public.comment_stars USING btree (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","columns":["comment_post_id","comment_user_id","user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","table":"public.comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","table":"public.comment_stars","referenced_table":"comments","columns":["comment_user_id","comment_post_id","comment_post_id","comment_user_id"],"referenced_columns":["post_id","post_id","user_id","user_id"],"comment":""},{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","referenced_table":"","columns":["comment_user_id","comment_post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.logs","type":"BASE TABLE","comment":"audit log table","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"public.post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id,\n p.title,\n u.username AS post_user,\n c.comment,\n u2.username AS comment_user,\n c.created,\n c.updated\n FROM (((posts p\n LEFT JOIN comments c ON ((p.id = c.post_id)))\n LEFT JOIN users u ON ((u.id = p.user_id)))\n LEFT JOIN users u2 ON ((u2.id = c.user_id)))\n)","referenced_tables":["public.posts","public.comments","public.users"]},{"name":"public.post_comment_stars","type":"MATERIALIZED VIEW","comment":"","columns":[{"name":"id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"comment_star_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE MATERIALIZED VIEW post_comment_stars AS (\n SELECT cs.id,\n cu.username AS comment_user,\n csu.username AS comment_star_user,\n cs.created,\n cs.updated\n FROM (((comments c\n LEFT JOIN comment_stars cs ON (((cs.comment_post_id = c.id) AND (cs.comment_user_id = c.user_id))))\n LEFT JOIN users cu ON ((cu.id = cs.comment_user_id)))\n LEFT JOIN users csu ON ((csu.id = cs.user_id)))\n)","referenced_tables":["public.comments","public.comment_stars","public.users"]},{"name":"public.CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"CamelizeTable_id_key","def":"CREATE UNIQUE INDEX \"CamelizeTable_id_key\" ON public.\"CamelizeTable\" USING btree (id)","table":"public.CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"CamelizeTable_id_key","type":"UNIQUE","def":"UNIQUE (id)","table":"public.CamelizeTable","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"CamelizeTableId","type":"uuid","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphen-table_hyphen-column_key","def":"CREATE UNIQUE INDEX \"hyphen-table_hyphen-column_key\" ON public.\"hyphen-table\" USING btree (\"hyphen-column\")","table":"public.hyphen-table","columns":["hyphen-column"],"comment":""}],"constraints":[{"name":"hyphen-table_CamelizeTableId_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","table":"public.hyphen-table","referenced_table":"CamelizeTable","columns":["CamelizeTableId"],"referenced_columns":["id"],"comment":""},{"name":"hyphen-table_hyphen-column_key","type":"UNIQUE","def":"UNIQUE (\"hyphen-column\")","table":"public.hyphen-table","referenced_table":"","columns":["hyphen-column"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASE TABLE","comment":"admin blogs","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('administrator.blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON administrator.blogs USING btree (id)","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"administrator.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blogs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"dump","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON backup.blogs USING btree (id)","table":"backup.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blog_options","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blog_options_id_seq'::regclass)","comment":""},{"name":"blog_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"label","type":"text","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blog_options_pkey","def":"CREATE UNIQUE INDEX blog_options_pkey ON backup.blog_options USING btree (id)","table":"backup.blog_options","columns":["id"],"comment":""}],"constraints":[{"name":"blog_options_blog_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","table":"backup.blog_options","referenced_table":"blogs","columns":["blog_id"],"referenced_columns":["id"],"comment":""},{"name":"blog_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blog_options","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.bar","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"bar_pkey","def":"CREATE UNIQUE INDEX bar_pkey ON \"time\".bar USING btree (id)","table":"time.bar","columns":["id"],"comment":""}],"constraints":[{"name":"bar_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.bar","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.hyphenated-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphenated-table_pkey","def":"CREATE UNIQUE INDEX \"hyphenated-table_pkey\" ON \"time\".\"hyphenated-table\" USING btree (id)","table":"time.hyphenated-table","columns":["id"],"comment":""}],"constraints":[{"name":"hyphenated-table_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.hyphenated-table","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.referencing","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"bar_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"ht_id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"referencing_pkey","def":"CREATE UNIQUE INDEX referencing_pkey ON \"time\".referencing USING btree (id)","table":"time.referencing","columns":["id"],"comment":""}],"constraints":[{"name":"referencing_bar_id","type":"FOREIGN KEY","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","table":"time.referencing","referenced_table":"bar","columns":["bar_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_ht_id","type":"FOREIGN KEY","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","table":"time.referencing","referenced_table":"hyphenated-table","columns":["ht_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.referencing","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"public.user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id)","virtual":false},{"table":"public.comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","virtual":false},{"table":"public.hyphen-table","columns":["CamelizeTableId"],"cardinality":"Zero or more","parent_table":"public.CamelizeTable","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"backup.blog_options","columns":["blog_id"],"cardinality":"Zero or more","parent_table":"backup.blogs","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","virtual":false},{"table":"time.referencing","columns":["bar_id"],"cardinality":"Zero or more","parent_table":"time.bar","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","virtual":false},{"table":"time.referencing","columns":["ht_id"],"cardinality":"Zero or more","parent_table":"time.hyphenated-table","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","virtual":false},{"table":"public.logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"public.logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"public.comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"public.uuid_nil","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_dns","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_url","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_oid","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_x500","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1mc","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v3","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.uuid_generate_v4","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v5","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.update_updated","return_type":"trigger","arguments":"","type":"FUNCTION"}],"driver":{"name":"postgres","database_version":"PostgreSQL 9.5.25 on x86_64-pc-linux-gnu (Debian 9.5.25-1.pgdg90+1), compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit","meta":{"current_schema":"public","search_paths":["\"$user\"","public","backup"],"dict":{"Functions":"Stored procedures and functions"}}}} +{"name":"testdb","desc":"Sample PostgreSQL database document.","tables":[{"name":"public.users","type":"BASE TABLE","comment":"Users table","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('users_id_seq'::regclass)","comment":""},{"name":"username","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"password","type":"varchar(50)","nullable":false,"default":null,"comment":""},{"name":"email","type":"varchar(355)","nullable":false,"default":null,"comment":"ex. user@example.com"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_pkey","def":"CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)","table":"public.users","columns":["id"],"comment":""},{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON public.users USING btree (username)","table":"public.users","columns":["username"],"comment":""},{"name":"users_email_key","def":"CREATE UNIQUE INDEX users_email_key ON public.users USING btree (email)","table":"public.users","columns":["email"],"comment":""}],"constraints":[{"name":"users_username_check","type":"CHECK","def":"CHECK ((char_length((username)::text) \u003e 4))","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.users","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"users_username_key","type":"UNIQUE","def":"UNIQUE (username)","table":"public.users","referenced_table":"","columns":["username"],"referenced_columns":[],"comment":""},{"name":"users_email_key","type":"UNIQUE","def":"UNIQUE (email)","table":"public.users","referenced_table":"","columns":["email"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_users_updated","def":"CREATE TRIGGER update_users_updated AFTER INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE PROCEDURE update_updated()","comment":"Update updated when users insert or update"}],"def":""},{"name":"public.user_options","type":"BASE TABLE","comment":"User options table","columns":[{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"show_email","type":"boolean","nullable":false,"default":"false","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"user_options_pkey","def":"CREATE UNIQUE INDEX user_options_pkey ON public.user_options USING btree (user_id)","table":"public.user_options","columns":["user_id"],"comment":"PRIMARY KEY"}],"constraints":[{"name":"user_options_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"FK"},{"name":"user_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"public.user_options","referenced_table":"","columns":["user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.posts","type":"BASE TABLE","comment":"Posts table","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('posts_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"title","type":"varchar(255)","nullable":false,"default":"'Untitled'::character varying","comment":""},{"name":"body","type":"text","nullable":false,"default":null,"comment":"post body"},{"name":"post_type","type":"post_types","nullable":false,"default":null,"comment":"public/private/draft"},{"name":"labels","type":"varchar(50)[]","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_id_pk","def":"CREATE UNIQUE INDEX posts_id_pk ON public.posts USING btree (id)","table":"public.posts","columns":["id"],"comment":""},{"name":"posts_user_id_title_key","def":"CREATE UNIQUE INDEX posts_user_id_title_key ON public.posts USING btree (user_id, title)","table":"public.posts","columns":["user_id","title"],"comment":""},{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON public.posts USING btree (user_id)","table":"public.posts","columns":["user_id"],"comment":"posts.user_id index"}],"constraints":[{"name":"update_posts_updated","type":"TRIGGER","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE update_updated()","table":"public.posts","referenced_table":"","columns":["updated","body","post_type","labels","created","tableoid","cmax","xmax","cmin","xmin","ctid","id","user_id","title"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"public.posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":"posts -\u003e users"},{"name":"posts_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.posts","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"posts_user_id_title_key","type":"UNIQUE","def":"UNIQUE (user_id, title)","table":"public.posts","referenced_table":"","columns":["user_id","title"],"referenced_columns":[],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE CONSTRAINT TRIGGER update_posts_updated AFTER INSERT OR UPDATE ON public.posts NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE update_updated()","comment":"Update updated when posts update"}],"def":""},{"name":"public.comments","type":"BASE TABLE","comment":"Comments\nMulti-line\r\ntable\rcomment","columns":[{"name":"id","type":"bigint","nullable":false,"default":"nextval('comments_id_seq'::regclass)","comment":""},{"name":"post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment","type":"text","nullable":false,"default":null,"comment":"Comment\nMulti-line\r\ncolumn\rcomment"},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_id_pk","def":"CREATE UNIQUE INDEX comments_id_pk ON public.comments USING btree (id)","table":"public.comments","columns":["id"],"comment":""},{"name":"comments_post_id_user_id_key","def":"CREATE UNIQUE INDEX comments_post_id_user_id_key ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""},{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON public.comments USING btree (post_id, user_id)","table":"public.comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"comments_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id)","table":"public.comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","table":"public.comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"comments_id_pk","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"public.comments","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""},{"name":"comments_post_id_user_id_key","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"public.comments","referenced_table":"","columns":["post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.comment_stars","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"bigint","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","def":"CREATE UNIQUE INDEX comment_stars_user_id_comment_post_id_comment_user_id_key ON public.comment_stars USING btree (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"comment_stars_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","table":"public.comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"comment_stars_user_id_post_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","table":"public.comment_stars","referenced_table":"comments","columns":["comment_user_id","comment_post_id","comment_post_id","comment_user_id"],"referenced_columns":["post_id","post_id","user_id","user_id"],"comment":""},{"name":"comment_stars_user_id_comment_post_id_comment_user_id_key","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"public.comment_stars","referenced_table":"","columns":["comment_user_id","comment_post_id","user_id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.logs","type":"BASE TABLE","comment":"audit log table","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"bigint","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"payload","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":""},{"name":"public.post_comments","type":"VIEW","comment":"post and comments View table","columns":[{"name":"id","type":"bigint","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"varchar(255)","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"varchar(50)","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"text","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS (\n SELECT c.id,\n p.title,\n u.username AS post_user,\n c.comment,\n u2.username AS comment_user,\n c.created,\n c.updated\n FROM (((posts p\n LEFT JOIN comments c ON ((p.id = c.post_id)))\n LEFT JOIN users u ON ((u.id = p.user_id)))\n LEFT JOIN users u2 ON ((u2.id = c.user_id)))\n)","referenced_tables":["public.posts","public.comments","public.users"]},{"name":"public.post_comment_stars","type":"MATERIALIZED VIEW","comment":"","columns":[{"name":"id","type":"uuid","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"comment_star_user","type":"varchar(50)","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE MATERIALIZED VIEW post_comment_stars AS (\n SELECT cs.id,\n cu.username AS comment_user,\n csu.username AS comment_star_user,\n cs.created,\n cs.updated\n FROM (((comments c\n LEFT JOIN comment_stars cs ON (((cs.comment_post_id = c.id) AND (cs.comment_user_id = c.user_id))))\n LEFT JOIN users cu ON ((cu.id = cs.comment_user_id)))\n LEFT JOIN users csu ON ((csu.id = cs.user_id)))\n)","referenced_tables":["public.comments","public.comment_stars","public.users"]},{"name":"public.CamelizeTable","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"CamelizeTable_id_key","def":"CREATE UNIQUE INDEX \"CamelizeTable_id_key\" ON public.\"CamelizeTable\" USING btree (id)","table":"public.CamelizeTable","columns":["id"],"comment":""}],"constraints":[{"name":"CamelizeTable_id_key","type":"UNIQUE","def":"UNIQUE (id)","table":"public.CamelizeTable","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"public.hyphen-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"uuid","nullable":false,"default":"uuid_generate_v4()","comment":""},{"name":"hyphen-column","type":"text","nullable":false,"default":null,"comment":""},{"name":"CamelizeTableId","type":"uuid","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphen-table_hyphen-column_key","def":"CREATE UNIQUE INDEX \"hyphen-table_hyphen-column_key\" ON public.\"hyphen-table\" USING btree (\"hyphen-column\")","table":"public.hyphen-table","columns":["hyphen-column"],"comment":""}],"constraints":[{"name":"hyphen-table_CamelizeTableId_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","table":"public.hyphen-table","referenced_table":"CamelizeTable","columns":["CamelizeTableId"],"referenced_columns":["id"],"comment":""},{"name":"hyphen-table_hyphen-column_key","type":"UNIQUE","def":"UNIQUE (\"hyphen-column\")","table":"public.hyphen-table","referenced_table":"","columns":["hyphen-column"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"administrator.blogs","type":"BASE TABLE","comment":"admin blogs","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('administrator.blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"name","type":"text","nullable":false,"default":null,"comment":""},{"name":"description","type":"text","nullable":true,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON administrator.blogs USING btree (id)","table":"administrator.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_user_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","table":"administrator.blogs","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"administrator.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blogs","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blogs_id_seq'::regclass)","comment":""},{"name":"user_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"dump","type":"text","nullable":false,"default":null,"comment":""},{"name":"created","type":"timestamp without time zone","nullable":false,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blogs_pkey","def":"CREATE UNIQUE INDEX blogs_pkey ON backup.blogs USING btree (id)","table":"backup.blogs","columns":["id"],"comment":""}],"constraints":[{"name":"blogs_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blogs","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"backup.blog_options","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":"nextval('blog_options_id_seq'::regclass)","comment":""},{"name":"blog_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"label","type":"text","nullable":true,"default":null,"comment":""},{"name":"updated","type":"timestamp without time zone","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"blog_options_pkey","def":"CREATE UNIQUE INDEX blog_options_pkey ON backup.blog_options USING btree (id)","table":"backup.blog_options","columns":["id"],"comment":""}],"constraints":[{"name":"blog_options_blog_id_fk","type":"FOREIGN KEY","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","table":"backup.blog_options","referenced_table":"blogs","columns":["blog_id"],"referenced_columns":["id"],"comment":""},{"name":"blog_options_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"backup.blog_options","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.bar","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"bar_pkey","def":"CREATE UNIQUE INDEX bar_pkey ON \"time\".bar USING btree (id)","table":"time.bar","columns":["id"],"comment":""}],"constraints":[{"name":"bar_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.bar","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.hyphenated-table","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"hyphenated-table_pkey","def":"CREATE UNIQUE INDEX \"hyphenated-table_pkey\" ON \"time\".\"hyphenated-table\" USING btree (id)","table":"time.hyphenated-table","columns":["id"],"comment":""}],"constraints":[{"name":"hyphenated-table_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.hyphenated-table","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""},{"name":"time.referencing","type":"BASE TABLE","comment":"","columns":[{"name":"id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"bar_id","type":"integer","nullable":false,"default":null,"comment":""},{"name":"ht_id","type":"integer","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"referencing_pkey","def":"CREATE UNIQUE INDEX referencing_pkey ON \"time\".referencing USING btree (id)","table":"time.referencing","columns":["id"],"comment":""}],"constraints":[{"name":"referencing_bar_id","type":"FOREIGN KEY","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","table":"time.referencing","referenced_table":"bar","columns":["bar_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_ht_id","type":"FOREIGN KEY","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","table":"time.referencing","referenced_table":"hyphenated-table","columns":["ht_id"],"referenced_columns":["id"],"comment":""},{"name":"referencing_pkey","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"time.referencing","referenced_table":"","columns":["id"],"referenced_columns":[],"comment":""}],"triggers":[],"def":""}],"relations":[{"table":"public.user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"public.comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id)","virtual":false},{"table":"public.comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users(id)","virtual":false},{"table":"public.comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id)","virtual":false},{"table":"public.hyphen-table","columns":["CamelizeTableId"],"cardinality":"Zero or more","parent_table":"public.CamelizeTable","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (\"CamelizeTableId\") REFERENCES \"CamelizeTable\"(id) ON DELETE CASCADE","virtual":false},{"table":"administrator.blogs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE","virtual":false},{"table":"backup.blog_options","columns":["blog_id"],"cardinality":"Zero or more","parent_table":"backup.blogs","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE","virtual":false},{"table":"time.referencing","columns":["bar_id"],"cardinality":"Zero or more","parent_table":"time.bar","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (bar_id) REFERENCES \"time\".bar(id)","virtual":false},{"table":"time.referencing","columns":["ht_id"],"cardinality":"Zero or more","parent_table":"time.hyphenated-table","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (ht_id) REFERENCES \"time\".\"hyphenated-table\"(id)","virtual":false},{"table":"public.logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"public.users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"public.logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"public.posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"public.comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"public.logs","columns":["comment_star_id"],"cardinality":"Zero or more","parent_table":"public.comment_stars","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true}],"functions":[{"name":"public.uuid_nil","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_dns","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_url","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_oid","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_ns_x500","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v1mc","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v3","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.uuid_generate_v4","return_type":"uuid","arguments":"","type":"FUNCTION"},{"name":"public.uuid_generate_v5","return_type":"uuid","arguments":"namespace uuid, name text","type":"FUNCTION"},{"name":"public.update_updated","return_type":"trigger","arguments":"","type":"FUNCTION"}],"enums":[{"name":"public.post_types","values":["draft","private","public"]}],"driver":{"name":"postgres","database_version":"PostgreSQL 9.5.25 on x86_64-pc-linux-gnu (Debian 9.5.25-1.pgdg90+1), compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit","meta":{"current_schema":"public","search_paths":["postgres","public","backup"],"dict":{"Functions":"Stored procedures and functions"}}}} diff --git a/sample/postgres95/schema.svg b/sample/postgres95/schema.svg index a322dc2f3..668c41df7 100644 --- a/sample/postgres95/schema.svg +++ b/sample/postgres95/schema.svg @@ -1,487 +1,487 @@ - - - + + testdb - + public.users - - -public.users -     -[BASE TABLE] - -id     -[integer] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.users +     +[BASE TABLE] + +id +[integer] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options - - -public.user_options -     -[BASE TABLE] - -user_id     -[integer] - -show_email     -[boolean] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.user_options +     +[BASE TABLE] + +user_id +[integer] + +show_email +[boolean] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.user_options:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.posts - - -public.posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[integer] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[post_types] - -labels     -[varchar(50)[]] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[integer] + +title +[varchar(255)] + +body +[text] + +post_type +[post_types] + +labels +[varchar(50)[]] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.posts:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE public.comments - - -public.comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[integer] - -comment     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[integer] + +comment +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comments:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) + + +FOREIGN KEY (user_id) REFERENCES users(id) public.comments:post_id->public.posts:id - - -FOREIGN KEY (post_id) REFERENCES posts(id) + + +FOREIGN KEY (post_id) REFERENCES posts(id) public.comment_stars - - -public.comment_stars -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -comment_post_id     -[bigint] - -comment_user_id     -[integer] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.comment_stars +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +comment_post_id +[bigint] + +comment_user_id +[integer] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.comment_stars:comment_user_id->public.users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users(id) + + +FOREIGN KEY (comment_user_id) REFERENCES users(id) public.comment_stars:comment_post_id->public.comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id) public.logs - - -public.logs -     -[BASE TABLE] - -id     -[uuid] - -user_id     -[integer] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[uuid] - -payload     -[text] - -created     -[timestamp without time zone] + + +public.logs +     +[BASE TABLE] + +id +[uuid] + +user_id +[integer] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[uuid] + +payload +[text] + +created +[timestamp without time zone] public.logs:user_id->public.users:id - - -logs->users + + +logs->users public.logs:post_id->public.posts:id - - -Additional Relation + + +Additional Relation public.logs:comment_id->public.comments:id - - -Additional Relation + + +Additional Relation public.logs:comment_star_id->public.comment_stars:id - - -Additional Relation + + +Additional Relation public.post_comments - - -public.post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.post_comment_stars - - -public.post_comment_stars -     -[MATERIALIZED VIEW] - -id     -[uuid] - -comment_user     -[varchar(50)] - -comment_star_user     -[varchar(50)] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +public.post_comment_stars +     +[MATERIALIZED VIEW] + +id +[uuid] + +comment_user +[varchar(50)] + +comment_star_user +[varchar(50)] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] public.CamelizeTable - - -public.CamelizeTable -     -[BASE TABLE] - -id     -[uuid] - -created     -[timestamp without time zone] + + +public.CamelizeTable +     +[BASE TABLE] + +id +[uuid] + +created +[timestamp without time zone] public.hyphen-table - - -public.hyphen-table -     -[BASE TABLE] - -id     -[uuid] - -hyphen-column     -[text] - -CamelizeTableId     -[uuid] - -created     -[timestamp without time zone] + + +public.hyphen-table +     +[BASE TABLE] + +id +[uuid] + +hyphen-column +[text] + +CamelizeTableId +[uuid] + +created +[timestamp without time zone] public.hyphen-table:CamelizeTableId->public.CamelizeTable:id - - -FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE + + +FOREIGN KEY ("CamelizeTableId") REFERENCES "CamelizeTable"(id) ON DELETE CASCADE administrator.blogs - - -administrator.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -name     -[text] - -description     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +administrator.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +name +[text] + +description +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] administrator.blogs:user_id->public.users:id - - -FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE + + +FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE backup.blogs - - -backup.blogs -     -[BASE TABLE] - -id     -[integer] - -user_id     -[integer] - -dump     -[text] - -created     -[timestamp without time zone] - -updated     -[timestamp without time zone] + + +backup.blogs +     +[BASE TABLE] + +id +[integer] + +user_id +[integer] + +dump +[text] + +created +[timestamp without time zone] + +updated +[timestamp without time zone] backup.blog_options - - -backup.blog_options -     -[BASE TABLE] - -id     -[integer] - -blog_id     -[integer] - -label     -[text] - -updated     -[timestamp without time zone] + + +backup.blog_options +     +[BASE TABLE] + +id +[integer] + +blog_id +[integer] + +label +[text] + +updated +[timestamp without time zone] backup.blog_options:blog_id->backup.blogs:id - - -FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE + + +FOREIGN KEY (blog_id) REFERENCES blogs(id) ON DELETE CASCADE time.bar - - -time.bar -     -[BASE TABLE] - -id     -[integer] + + +time.bar +     +[BASE TABLE] + +id +[integer] time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id     -[integer] + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/postgres95/time.bar.svg b/sample/postgres95/time.bar.svg index 414a70543..4689ff73b 100644 --- a/sample/postgres95/time.bar.svg +++ b/sample/postgres95/time.bar.svg @@ -1,51 +1,51 @@ - - - + + time.bar - + time.bar - - -time.bar -     -[BASE TABLE] - -id -[integer] - + + +time.bar +     +[BASE TABLE] + +id +[integer] + time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) diff --git a/sample/postgres95/time.hyphenated-table.svg b/sample/postgres95/time.hyphenated-table.svg index a4f994d60..4b639940f 100644 --- a/sample/postgres95/time.hyphenated-table.svg +++ b/sample/postgres95/time.hyphenated-table.svg @@ -1,51 +1,51 @@ - - - + + time.hyphenated-table - + time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id -[integer] - + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] + time.referencing - - -time.referencing -     -[BASE TABLE] - -id     -[integer] - -bar_id     -[integer] - -ht_id     -[integer] + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/postgres95/time.referencing.svg b/sample/postgres95/time.referencing.svg index b224b74c2..e85bb6a69 100644 --- a/sample/postgres95/time.referencing.svg +++ b/sample/postgres95/time.referencing.svg @@ -1,70 +1,70 @@ - - - + + time.referencing - + time.referencing - - -time.referencing -     -[BASE TABLE] - -id -[integer] - -bar_id -[integer] - -ht_id -[integer] - + + +time.referencing +     +[BASE TABLE] + +id +[integer] + +bar_id +[integer] + +ht_id +[integer] + time.bar - - -time.bar -     -[BASE TABLE] - -id     -[integer] + + +time.bar +     +[BASE TABLE] + +id +[integer] time.referencing:bar_id->time.bar:id - - -FOREIGN KEY (bar_id) REFERENCES "time".bar(id) + + +FOREIGN KEY (bar_id) REFERENCES "time".bar(id) time.hyphenated-table - - -time.hyphenated-table -     -[BASE TABLE] - -id     -[integer] + + +time.hyphenated-table +     +[BASE TABLE] + +id +[integer] time.referencing:ht_id->time.hyphenated-table:id - - -FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) + + +FOREIGN KEY (ht_id) REFERENCES "time"."hyphenated-table"(id) diff --git a/sample/sqlite/CamelizeTable.svg b/sample/sqlite/CamelizeTable.svg index 1162a0811..7879bae02 100644 --- a/sample/sqlite/CamelizeTable.svg +++ b/sample/sqlite/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[table] - -id -[INTEGER] - -created -[NUMERIC] - + + +CamelizeTable +     +[table] + +id +[INTEGER] + +created +[NUMERIC] + diff --git a/sample/sqlite/access_log.svg b/sample/sqlite/access_log.svg index f22753893..39144fe95 100644 --- a/sample/sqlite/access_log.svg +++ b/sample/sqlite/access_log.svg @@ -1,26 +1,26 @@ - - - + + access_log - + access_log - - -access_log -     -[virtual table] - -logs -[] - + + +access_log +     +[virtual table] + +logs +[] + diff --git a/sample/sqlite/check_constraints.svg b/sample/sqlite/check_constraints.svg index 09e339125..8885fecd0 100644 --- a/sample/sqlite/check_constraints.svg +++ b/sample/sqlite/check_constraints.svg @@ -1,41 +1,41 @@ - - - + + check_constraints - + check_constraints - - -check_constraints -     -[table] - -id -[INTEGER] - -col -[TEXT] - -brackets -[TEXT] - -checkcheck -[TEXT] - -downcase -[TEXT] - -nl -[TEXT] - + + +check_constraints +     +[table] + +id +[INTEGER] + +col +[TEXT] + +brackets +[TEXT] + +checkcheck +[TEXT] + +downcase +[TEXT] + +nl +[TEXT] + diff --git a/sample/sqlite/comment_stars.svg b/sample/sqlite/comment_stars.svg index 737e53e86..db5578da0 100644 --- a/sample/sqlite/comment_stars.svg +++ b/sample/sqlite/comment_stars.svg @@ -1,146 +1,146 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[table] - -id -[INTEGER] - -user_id -[INTEGER] - -comment_post_id -[INTEGER] - -comment_user_id -[INTEGER] - -created -[NUMERIC] - -updated -[NUMERIC] - + + +comment_stars +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +comment_post_id +[INTEGER] + +comment_user_id +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] + comments - - -comments -     -[table] - -id     -[INTEGER] - -post_id     -[INTEGER] - -user_id     -[INTEGER] - -comment     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comments +     +[table] + +id +[INTEGER] + +post_id +[INTEGER] + +user_id +[INTEGER] + +comment +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE users - - -users -     -[table] - -id     -[INTEGER] - -username     -[TEXT] - -password     -[TEXT] - -email     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +users +     +[table] + +id +[INTEGER] + +username +[TEXT] + +password +[TEXT] + +email +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE logs - - -logs -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -post_id     -[INTEGER] - -comment_id     -[INTEGER] - -comment_star_id     -[INTEGER] - -payload     -[TEXT] - -created     -[NUMERIC] + + +logs +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +post_id +[INTEGER] + +comment_id +[INTEGER] + +comment_star_id +[INTEGER] + +payload +[TEXT] + +created +[NUMERIC] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/sqlite/comments.svg b/sample/sqlite/comments.svg index 0ef1485a7..05e32debb 100644 --- a/sample/sqlite/comments.svg +++ b/sample/sqlite/comments.svg @@ -1,180 +1,180 @@ - - - + + comments - + comments - - -comments -     -[table] - -id -[INTEGER] - -post_id -[INTEGER] - -user_id -[INTEGER] - -comment -[TEXT] - -created -[NUMERIC] - -updated -[NUMERIC] - + + +comments +     +[table] + +id +[INTEGER] + +post_id +[INTEGER] + +user_id +[INTEGER] + +comment +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] + posts - - -posts -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -title     -[TEXT] - -body     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +posts +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +title +[TEXT] + +body +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE users - - -users -     -[table] - -id     -[INTEGER] - -username     -[TEXT] - -password     -[TEXT] - -email     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +users +     +[table] + +id +[INTEGER] + +username +[TEXT] + +password +[TEXT] + +email +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE logs - - -logs -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -post_id     -[INTEGER] - -comment_id     -[INTEGER] - -comment_star_id     -[INTEGER] - -payload     -[TEXT] - -created     -[NUMERIC] + + +logs +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +post_id +[INTEGER] + +comment_id +[INTEGER] + +comment_star_id +[INTEGER] + +payload +[TEXT] + +created +[NUMERIC] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -comment_post_id     -[INTEGER] - -comment_user_id     -[INTEGER] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comment_stars +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +comment_post_id +[INTEGER] + +comment_user_id +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE diff --git a/sample/sqlite/hyphen-table.svg b/sample/sqlite/hyphen-table.svg index 2da8e61f3..dd7696de1 100644 --- a/sample/sqlite/hyphen-table.svg +++ b/sample/sqlite/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[table] - -id -[INTEGER] - -hyphen-column -[TEXT] - -created -[NUMERIC] - + + +hyphen-table +     +[table] + +id +[INTEGER] + +hyphen-column +[TEXT] + +created +[NUMERIC] + diff --git a/sample/sqlite/logs.svg b/sample/sqlite/logs.svg index bc0312189..2fad14ffb 100644 --- a/sample/sqlite/logs.svg +++ b/sample/sqlite/logs.svg @@ -1,180 +1,180 @@ - - - + + logs - + logs - - -logs -     -[table] - -id -[INTEGER] - -user_id -[INTEGER] - -post_id -[INTEGER] - -comment_id -[INTEGER] - -comment_star_id -[INTEGER] - -payload -[TEXT] - -created -[NUMERIC] - + + +logs +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +post_id +[INTEGER] + +comment_id +[INTEGER] + +comment_star_id +[INTEGER] + +payload +[TEXT] + +created +[NUMERIC] + users - - -users -     -[table] - -id     -[INTEGER] - -username     -[TEXT] - -password     -[TEXT] - -email     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +users +     +[table] + +id +[INTEGER] + +username +[TEXT] + +password +[TEXT] + +email +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] logs:user_id->users:id - - -logs->users + + +logs->users posts - - -posts -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -title     -[TEXT] - -body     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +posts +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +title +[TEXT] + +body +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation comments - - -comments -     -[table] - -id     -[INTEGER] - -post_id     -[INTEGER] - -user_id     -[INTEGER] - -comment     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comments +     +[table] + +id +[INTEGER] + +post_id +[INTEGER] + +user_id +[INTEGER] + +comment +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -comment_post_id     -[INTEGER] - -comment_user_id     -[INTEGER] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comment_stars +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +comment_post_id +[INTEGER] + +comment_user_id +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/sqlite/post_comments.svg b/sample/sqlite/post_comments.svg index e0a7b4499..4964bc330 100644 --- a/sample/sqlite/post_comments.svg +++ b/sample/sqlite/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[view] - -id -[INTEGER] - -title -[TEXT] - -post_user -[TEXT] - -comment -[TEXT] - -comment_user -[TEXT] - -created -[NUMERIC] - -updated -[NUMERIC] - + + +post_comments +     +[view] + +id +[INTEGER] + +title +[TEXT] + +post_user +[TEXT] + +comment +[TEXT] + +comment_user +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] + diff --git a/sample/sqlite/posts.svg b/sample/sqlite/posts.svg index 0ffd51141..d182ac2a6 100644 --- a/sample/sqlite/posts.svg +++ b/sample/sqlite/posts.svg @@ -1,146 +1,146 @@ - - - + + posts - + posts - - -posts -     -[table] - -id -[INTEGER] - -user_id -[INTEGER] - -title -[TEXT] - -body -[TEXT] - -created -[NUMERIC] - -updated -[NUMERIC] - + + +posts +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +title +[TEXT] + +body +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] + users - - -users -     -[table] - -id     -[INTEGER] - -username     -[TEXT] - -password     -[TEXT] - -email     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +users +     +[table] + +id +[INTEGER] + +username +[TEXT] + +password +[TEXT] + +email +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE comments - - -comments -     -[table] - -id     -[INTEGER] - -post_id     -[INTEGER] - -user_id     -[INTEGER] - -comment     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comments +     +[table] + +id +[INTEGER] + +post_id +[INTEGER] + +user_id +[INTEGER] + +comment +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE logs - - -logs -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -post_id     -[INTEGER] - -comment_id     -[INTEGER] - -comment_star_id     -[INTEGER] - -payload     -[TEXT] - -created     -[NUMERIC] + + +logs +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +post_id +[INTEGER] + +comment_id +[INTEGER] + +comment_star_id +[INTEGER] + +payload +[TEXT] + +created +[NUMERIC] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/sqlite/schema.json b/sample/sqlite/schema.json index c18915cb4..0805c2556 100644 --- a/sample/sqlite/schema.json +++ b/sample/sqlite/schema.json @@ -1 +1 @@ -{"name":"testdb.sqlite3","desc":"Sample database document.","tables":[{"name":"users","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"username","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"password","type":"TEXT","nullable":false,"default":null,"comment":"","labels":[{"Name":"secure","Virtual":true},{"Name":"encrypted","Virtual":true}]},{"name":"email","type":"TEXT","nullable":false,"default":null,"comment":"","labels":[{"Name":"secure","Virtual":true}]},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON users(username)","table":"users","columns":["username"],"comment":""},{"name":"sqlite_autoindex_users_2","def":"UNIQUE (email)","table":"users","columns":["email"],"comment":""},{"name":"sqlite_autoindex_users_1","def":"UNIQUE (username)","table":"users","columns":["username"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_users_2","type":"UNIQUE","def":"UNIQUE (email)","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_users_1","type":"UNIQUE","def":"UNIQUE (username)","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(length(username) \u003e 4)","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE users (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n username TEXT UNIQUE NOT NULL CHECK(length(username) \u003e 4),\n password TEXT NOT NULL,\n email TEXT UNIQUE NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC\n)"},{"name":"user_options","type":"table","comment":"","columns":[{"name":"user_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"show_email","type":"INTEGER","nullable":false,"default":"0","comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"user_id","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","table":"user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":"CREATE TABLE user_options (\n user_id INTEGER PRIMARY KEY,\n show_email INTEGER NOT NULL DEFAULT 0,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT user_options_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) MATCH NONE ON UPDATE NO ACTION ON DELETE CASCADE\n)"},{"name":"posts","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"title","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"body","type":"TEXT","nullable":false,"default":null,"comment":"post body"},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON posts(user_id)","table":"posts","columns":["user_id"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"posts","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","table":"posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE TRIGGER update_posts_updated AFTER UPDATE ON posts FOR EACH ROW\nBEGIN\n UPDATE posts SET updated = current_timestamp WHERE id = OLD.id;\nEND","comment":""}],"def":"CREATE TABLE posts (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n user_id INTEGER NOT NULL,\n title TEXT NOT NULL,\n body TEXT NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT posts_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) MATCH NONE ON UPDATE NO ACTION ON DELETE CASCADE\n)","labels":[{"Name":"green","Virtual":true},{"Name":"red","Virtual":true},{"Name":"blue","Virtual":true}]},{"name":"comments","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"post_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"comment","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON comments(post_id, user_id)","table":"comments","columns":["post_id","user_id"],"comment":""},{"name":"sqlite_autoindex_comments_1","def":"UNIQUE (post_id, user_id)","table":"comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comments","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"- (Foreign key ID: 1)","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"sqlite_autoindex_comments_1","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"comments","referenced_table":null,"columns":["post_id","user_id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE comments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n post_id INTEGER NOT NULL,\n user_id INTEGER NOT NULL,\n comment TEXT NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT comments_post_id_fk FOREIGN KEY(post_id) REFERENCES posts(id),\n CONSTRAINT comments_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id),\n UNIQUE(post_id, user_id)\n)"},{"name":"comment_stars","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"sqlite_autoindex_comment_stars_1","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comment_stars","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"- (Foreign key ID: 1)","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_user_id"],"referenced_columns":["post_id","user_id"],"comment":""},{"name":"sqlite_autoindex_comment_stars_1","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"comment_stars","referenced_table":null,"columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE comment_stars (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n user_id INTEGER NOT NULL,\n comment_post_id INTEGER NOT NULL,\n comment_user_id INTEGER NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT comment_stars_user_id_post_id_fk FOREIGN KEY(comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id),\n CONSTRAINT comment_stars_user_id_fk FOREIGN KEY(comment_user_id) REFERENCES users(id),\n UNIQUE(user_id, comment_post_id, comment_user_id)\n)"},{"name":"logs","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"payload","type":"TEXT","nullable":true,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"logs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE logs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n user_id INTEGER NOT NULL,\n post_id INTEGER,\n comment_id INTEGER,\n comment_star_id INTEGER,\n payload TEXT,\n created NUMERIC NOT NULL\n)"},{"name":"post_comments","type":"view","comment":"post and comments View table","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"TEXT","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"TEXT","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"TEXT","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"TEXT","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"NUMERIC","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS\n SELECT c.id, p.title, u2.username AS post_user, c.comment, u2.username AS comment_user, c.created, c.updated\n FROM posts AS p\n LEFT JOIN comments AS c on p.id = c.post_id\n LEFT JOIN users AS u on u.id = p.user_id\n LEFT JOIN users AS u2 on u2.id = c.user_id","referenced_tables":["posts","comments","users"]},{"name":"CamelizeTable","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"CamelizeTable","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE CamelizeTable (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n created NUMERIC NOT NULL\n)"},{"name":"hyphen-table","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"hyphen-column","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"hyphen-table","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE 'hyphen-table' (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n 'hyphen-column' TEXT NOT NULL,\n created NUMERIC NOT NULL\n)"},{"name":"check_constraints","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"col","type":"TEXT","nullable":true,"default":null,"comment":""},{"name":"brackets","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"checkcheck","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"downcase","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"nl","type":"TEXT","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"sqlite_autoindex_check_constraints_4","def":"UNIQUE (nl)","table":"check_constraints","columns":["nl"],"comment":""},{"name":"sqlite_autoindex_check_constraints_3","def":"UNIQUE (downcase)","table":"check_constraints","columns":["downcase"],"comment":""},{"name":"sqlite_autoindex_check_constraints_2","def":"UNIQUE (checkcheck)","table":"check_constraints","columns":["checkcheck"],"comment":""},{"name":"sqlite_autoindex_check_constraints_1","def":"UNIQUE (brackets)","table":"check_constraints","columns":["brackets"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"check_constraints","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_4","type":"UNIQUE","def":"UNIQUE (nl)","table":"check_constraints","referenced_table":null,"columns":["nl"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_3","type":"UNIQUE","def":"UNIQUE (downcase)","table":"check_constraints","referenced_table":null,"columns":["downcase"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_2","type":"UNIQUE","def":"UNIQUE (checkcheck)","table":"check_constraints","referenced_table":null,"columns":["checkcheck"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_1","type":"UNIQUE","def":"UNIQUE (brackets)","table":"check_constraints","referenced_table":null,"columns":["brackets"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(length(col) \u003e 4)","table":"check_constraints","referenced_table":null,"columns":["col"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(((length(brackets) \u003e 4)))","table":"check_constraints","referenced_table":null,"columns":["brackets"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(length(checkcheck) \u003e 4)","table":"check_constraints","referenced_table":null,"columns":["checkcheck"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"check(length(downcase) \u003e 4)","table":"check_constraints","referenced_table":null,"columns":["downcase"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"check(length(nl) \u003e 4 OR nl != 'ln')","table":"check_constraints","referenced_table":null,"columns":["nl"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE check_constraints (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n col TEXT CHECK(length(col) \u003e 4),\n brackets TEXT UNIQUE NOT NULL CHECK(((length(brackets) \u003e 4))),\n checkcheck TEXT UNIQUE NOT NULL CHECK(length(checkcheck) \u003e 4),\n downcase TEXT UNIQUE NOT NULL check(length(downcase) \u003e 4),\n nl TEXT UNIQUE NOT\n NULL check(length(nl) \u003e 4 OR\n nl != 'ln')\n)"},{"name":"syslog","type":"virtual table","comment":"","columns":[{"name":"logs","type":"","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIRTUAL TABLE syslog USING fts3(logs)"},{"name":"access_log","type":"virtual table","comment":"","columns":[{"name":"logs","type":"","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIRTUAL TABLE access_log USING fts4(logs)"}],"relations":[{"table":"user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","virtual":false},{"table":"posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","virtual":false},{"table":"comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_star_id"],"cardinality":"Exactly one","parent_table":"comment_stars","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"Additional Relation","virtual":true}],"functions":null,"driver":{"name":"sqlite","database_version":"3.45.1","meta":{}},"labels":[{"Name":"sample","Virtual":true},{"Name":"tbls","Virtual":true}]} +{"name":"testdb.sqlite3","desc":"Sample database document.","tables":[{"name":"users","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"username","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"password","type":"TEXT","nullable":false,"default":null,"comment":"","labels":[{"Name":"secure","Virtual":true},{"Name":"encrypted","Virtual":true}]},{"name":"email","type":"TEXT","nullable":false,"default":null,"comment":"","labels":[{"Name":"secure","Virtual":true}]},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"users_username_key","def":"CREATE UNIQUE INDEX users_username_key ON users(username)","table":"users","columns":["username"],"comment":""},{"name":"sqlite_autoindex_users_2","def":"UNIQUE (email)","table":"users","columns":["email"],"comment":""},{"name":"sqlite_autoindex_users_1","def":"UNIQUE (username)","table":"users","columns":["username"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"users","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_users_2","type":"UNIQUE","def":"UNIQUE (email)","table":"users","referenced_table":null,"columns":["email"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_users_1","type":"UNIQUE","def":"UNIQUE (username)","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(length(username) \u003e 4)","table":"users","referenced_table":null,"columns":["username"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE users (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n username TEXT UNIQUE NOT NULL CHECK(length(username) \u003e 4),\n password TEXT NOT NULL,\n email TEXT UNIQUE NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC\n)"},{"name":"user_options","type":"table","comment":"","columns":[{"name":"user_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"show_email","type":"INTEGER","nullable":false,"default":"0","comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"user_id","type":"PRIMARY KEY","def":"PRIMARY KEY (user_id)","table":"user_options","referenced_table":null,"columns":["user_id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","table":"user_options","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[],"def":"CREATE TABLE user_options (\n user_id INTEGER PRIMARY KEY,\n show_email INTEGER NOT NULL DEFAULT 0,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT user_options_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) MATCH NONE ON UPDATE NO ACTION ON DELETE CASCADE\n)"},{"name":"posts","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"title","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"body","type":"TEXT","nullable":false,"default":null,"comment":"post body"},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"posts_user_id_idx","def":"CREATE INDEX posts_user_id_idx ON posts(user_id)","table":"posts","columns":["user_id"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"posts","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","table":"posts","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""}],"triggers":[{"name":"update_posts_updated","def":"CREATE TRIGGER update_posts_updated AFTER UPDATE ON posts FOR EACH ROW\nBEGIN\n UPDATE posts SET updated = current_timestamp WHERE id = OLD.id;\nEND","comment":""}],"def":"CREATE TABLE posts (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n user_id INTEGER NOT NULL,\n title TEXT NOT NULL,\n body TEXT NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT posts_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id) MATCH NONE ON UPDATE NO ACTION ON DELETE CASCADE\n)","labels":[{"Name":"green","Virtual":true},{"Name":"red","Virtual":true},{"Name":"blue","Virtual":true}]},{"name":"comments","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"post_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"comment","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"comments_post_id_user_id_idx","def":"CREATE INDEX comments_post_id_user_id_idx ON comments(post_id, user_id)","table":"comments","columns":["post_id","user_id"],"comment":""},{"name":"sqlite_autoindex_comments_1","def":"UNIQUE (post_id, user_id)","table":"comments","columns":["post_id","user_id"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comments","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comments","referenced_table":"users","columns":["user_id"],"referenced_columns":["id"],"comment":""},{"name":"- (Foreign key ID: 1)","type":"FOREIGN KEY","def":"FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comments","referenced_table":"posts","columns":["post_id"],"referenced_columns":["id"],"comment":""},{"name":"sqlite_autoindex_comments_1","type":"UNIQUE","def":"UNIQUE (post_id, user_id)","table":"comments","referenced_table":null,"columns":["post_id","user_id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE comments (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n post_id INTEGER NOT NULL,\n user_id INTEGER NOT NULL,\n comment TEXT NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT comments_post_id_fk FOREIGN KEY(post_id) REFERENCES posts(id),\n CONSTRAINT comments_user_id_fk FOREIGN KEY(user_id) REFERENCES users(id),\n UNIQUE(post_id, user_id)\n)"},{"name":"comment_stars","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"comment_post_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"comment_user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":""}],"indexes":[{"name":"sqlite_autoindex_comment_stars_1","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"comment_stars","columns":["user_id","comment_post_id","comment_user_id"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"comment_stars","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"- (Foreign key ID: 0)","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comment_stars","referenced_table":"users","columns":["comment_user_id"],"referenced_columns":["id"],"comment":""},{"name":"- (Foreign key ID: 1)","type":"FOREIGN KEY","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","table":"comment_stars","referenced_table":"comments","columns":["comment_post_id","comment_user_id"],"referenced_columns":["post_id","user_id"],"comment":""},{"name":"sqlite_autoindex_comment_stars_1","type":"UNIQUE","def":"UNIQUE (user_id, comment_post_id, comment_user_id)","table":"comment_stars","referenced_table":null,"columns":["user_id","comment_post_id","comment_user_id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE comment_stars (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n user_id INTEGER NOT NULL,\n comment_post_id INTEGER NOT NULL,\n comment_user_id INTEGER NOT NULL,\n created NUMERIC NOT NULL,\n updated NUMERIC,\n CONSTRAINT comment_stars_user_id_post_id_fk FOREIGN KEY(comment_post_id, comment_user_id) REFERENCES comments(post_id, user_id),\n CONSTRAINT comment_stars_user_id_fk FOREIGN KEY(comment_user_id) REFERENCES users(id),\n UNIQUE(user_id, comment_post_id, comment_user_id)\n)"},{"name":"logs","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"user_id","type":"INTEGER","nullable":false,"default":null,"comment":""},{"name":"post_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"comment_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"comment_star_id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"payload","type":"TEXT","nullable":true,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"logs","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE logs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n user_id INTEGER NOT NULL,\n post_id INTEGER,\n comment_id INTEGER,\n comment_star_id INTEGER,\n payload TEXT,\n created NUMERIC NOT NULL\n)"},{"name":"post_comments","type":"view","comment":"post and comments View table","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":"comments.id"},{"name":"title","type":"TEXT","nullable":true,"default":null,"comment":"posts.title"},{"name":"post_user","type":"TEXT","nullable":true,"default":null,"comment":"posts.users.username"},{"name":"comment","type":"TEXT","nullable":true,"default":null,"comment":""},{"name":"comment_user","type":"TEXT","nullable":true,"default":null,"comment":"comments.users.username"},{"name":"created","type":"NUMERIC","nullable":true,"default":null,"comment":"comments.created"},{"name":"updated","type":"NUMERIC","nullable":true,"default":null,"comment":"comments.updated"}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIEW post_comments AS\n SELECT c.id, p.title, u2.username AS post_user, c.comment, u2.username AS comment_user, c.created, c.updated\n FROM posts AS p\n LEFT JOIN comments AS c on p.id = c.post_id\n LEFT JOIN users AS u on u.id = p.user_id\n LEFT JOIN users AS u2 on u2.id = c.user_id","referenced_tables":["posts","comments","users"]},{"name":"CamelizeTable","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"CamelizeTable","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE CamelizeTable (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n created NUMERIC NOT NULL\n)"},{"name":"hyphen-table","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"hyphen-column","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"created","type":"NUMERIC","nullable":false,"default":null,"comment":""}],"indexes":[],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"hyphen-table","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE 'hyphen-table' (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n 'hyphen-column' TEXT NOT NULL,\n created NUMERIC NOT NULL\n)"},{"name":"check_constraints","type":"table","comment":"","columns":[{"name":"id","type":"INTEGER","nullable":true,"default":null,"comment":""},{"name":"col","type":"TEXT","nullable":true,"default":null,"comment":""},{"name":"brackets","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"checkcheck","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"downcase","type":"TEXT","nullable":false,"default":null,"comment":""},{"name":"nl","type":"TEXT","nullable":false,"default":null,"comment":""}],"indexes":[{"name":"sqlite_autoindex_check_constraints_4","def":"UNIQUE (nl)","table":"check_constraints","columns":["nl"],"comment":""},{"name":"sqlite_autoindex_check_constraints_3","def":"UNIQUE (downcase)","table":"check_constraints","columns":["downcase"],"comment":""},{"name":"sqlite_autoindex_check_constraints_2","def":"UNIQUE (checkcheck)","table":"check_constraints","columns":["checkcheck"],"comment":""},{"name":"sqlite_autoindex_check_constraints_1","def":"UNIQUE (brackets)","table":"check_constraints","columns":["brackets"],"comment":""}],"constraints":[{"name":"id","type":"PRIMARY KEY","def":"PRIMARY KEY (id)","table":"check_constraints","referenced_table":null,"columns":["id"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_4","type":"UNIQUE","def":"UNIQUE (nl)","table":"check_constraints","referenced_table":null,"columns":["nl"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_3","type":"UNIQUE","def":"UNIQUE (downcase)","table":"check_constraints","referenced_table":null,"columns":["downcase"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_2","type":"UNIQUE","def":"UNIQUE (checkcheck)","table":"check_constraints","referenced_table":null,"columns":["checkcheck"],"referenced_columns":null,"comment":""},{"name":"sqlite_autoindex_check_constraints_1","type":"UNIQUE","def":"UNIQUE (brackets)","table":"check_constraints","referenced_table":null,"columns":["brackets"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(length(col) \u003e 4)","table":"check_constraints","referenced_table":null,"columns":["col"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(((length(brackets) \u003e 4)))","table":"check_constraints","referenced_table":null,"columns":["brackets"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"CHECK(length(checkcheck) \u003e 4)","table":"check_constraints","referenced_table":null,"columns":["checkcheck"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"check(length(downcase) \u003e 4)","table":"check_constraints","referenced_table":null,"columns":["downcase"],"referenced_columns":null,"comment":""},{"name":"-","type":"CHECK","def":"check(length(nl) \u003e 4 OR nl != 'ln')","table":"check_constraints","referenced_table":null,"columns":["nl"],"referenced_columns":null,"comment":""}],"triggers":[],"def":"CREATE TABLE check_constraints (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n col TEXT CHECK(length(col) \u003e 4),\n brackets TEXT UNIQUE NOT NULL CHECK(((length(brackets) \u003e 4))),\n checkcheck TEXT UNIQUE NOT NULL CHECK(length(checkcheck) \u003e 4),\n downcase TEXT UNIQUE NOT NULL check(length(downcase) \u003e 4),\n nl TEXT UNIQUE NOT\n NULL check(length(nl) \u003e 4 OR\n nl != 'ln')\n)"},{"name":"syslog","type":"virtual table","comment":"","columns":[{"name":"logs","type":"","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIRTUAL TABLE syslog USING fts3(logs)"},{"name":"access_log","type":"virtual table","comment":"","columns":[{"name":"logs","type":"","nullable":true,"default":null,"comment":""}],"indexes":[],"constraints":[],"triggers":[],"def":"CREATE VIRTUAL TABLE access_log USING fts4(logs)"}],"relations":[{"table":"user_options","columns":["user_id"],"cardinality":"Zero or one","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","virtual":false},{"table":"posts","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE","virtual":false},{"table":"comments","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"comments","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"comment_stars","columns":["comment_user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"comment_stars","columns":["comment_post_id","comment_user_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["post_id","user_id"],"parent_cardinality":"Exactly one","def":"FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE","virtual":false},{"table":"logs","columns":["user_id"],"cardinality":"Zero or more","parent_table":"users","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"logs-\u003eusers","virtual":true},{"table":"logs","columns":["post_id"],"cardinality":"Zero or more","parent_table":"posts","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_id"],"cardinality":"Zero or more","parent_table":"comments","parent_columns":["id"],"parent_cardinality":"Zero or one","def":"Additional Relation","virtual":true},{"table":"logs","columns":["comment_star_id"],"cardinality":"Exactly one","parent_table":"comment_stars","parent_columns":["id"],"parent_cardinality":"Exactly one","def":"Additional Relation","virtual":true}],"functions":null,"driver":{"name":"sqlite","database_version":"3.46.1","meta":{}},"labels":[{"Name":"sample","Virtual":true},{"Name":"tbls","Virtual":true}]} diff --git a/sample/sqlite/schema.svg b/sample/sqlite/schema.svg index bcf296341..38de1837f 100644 --- a/sample/sqlite/schema.svg +++ b/sample/sqlite/schema.svg @@ -1,356 +1,356 @@ - - - + + testdb.sqlite3 - + users - - -users -     -[table] - -id     -[INTEGER] - -username     -[TEXT] - -password     -[TEXT] - -email     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +users +     +[table] + +id +[INTEGER] + +username +[TEXT] + +password +[TEXT] + +email +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] user_options - - -user_options -     -[table] - -user_id     -[INTEGER] - -show_email     -[INTEGER] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +user_options +     +[table] + +user_id +[INTEGER] + +show_email +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE posts - - -posts -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -title     -[TEXT] - -body     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +posts +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +title +[TEXT] + +body +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE comments - - -comments -     -[table] - -id     -[INTEGER] - -post_id     -[INTEGER] - -user_id     -[INTEGER] - -comment     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comments +     +[table] + +id +[INTEGER] + +post_id +[INTEGER] + +user_id +[INTEGER] + +comment +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (post_id) REFERENCES posts (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE comment_stars - - -comment_stars -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -comment_post_id     -[INTEGER] - -comment_user_id     -[INTEGER] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comment_stars +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +comment_post_id +[INTEGER] + +comment_user_id +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE logs - - -logs -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -post_id     -[INTEGER] - -comment_id     -[INTEGER] - -comment_star_id     -[INTEGER] - -payload     -[TEXT] - -created     -[NUMERIC] + + +logs +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +post_id +[INTEGER] + +comment_id +[INTEGER] + +comment_star_id +[INTEGER] + +payload +[TEXT] + +created +[NUMERIC] logs:user_id->users:id - - -logs->users + + +logs->users logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation post_comments - - -post_comments -     -[view] - -id     -[INTEGER] - -title     -[TEXT] - -post_user     -[TEXT] - -comment     -[TEXT] - -comment_user     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +post_comments +     +[view] + +id +[INTEGER] + +title +[TEXT] + +post_user +[TEXT] + +comment +[TEXT] + +comment_user +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] CamelizeTable - - -CamelizeTable -     -[table] - -id     -[INTEGER] - -created     -[NUMERIC] + + +CamelizeTable +     +[table] + +id +[INTEGER] + +created +[NUMERIC] hyphen-table - - -hyphen-table -     -[table] - -id     -[INTEGER] - -hyphen-column     -[TEXT] - -created     -[NUMERIC] + + +hyphen-table +     +[table] + +id +[INTEGER] + +hyphen-column +[TEXT] + +created +[NUMERIC] check_constraints - - -check_constraints -     -[table] - -id     -[INTEGER] - -col     -[TEXT] - -brackets     -[TEXT] - -checkcheck     -[TEXT] - -downcase     -[TEXT] - -nl     -[TEXT] + + +check_constraints +     +[table] + +id +[INTEGER] + +col +[TEXT] + +brackets +[TEXT] + +checkcheck +[TEXT] + +downcase +[TEXT] + +nl +[TEXT] syslog - - -syslog -     -[virtual table] - -logs     -[] + + +syslog +     +[virtual table] + +logs +[] access_log - - -access_log -     -[virtual table] - -logs     -[] + + +access_log +     +[virtual table] + +logs +[] diff --git a/sample/sqlite/syslog.svg b/sample/sqlite/syslog.svg index 9f03aa5cb..eed4a5220 100644 --- a/sample/sqlite/syslog.svg +++ b/sample/sqlite/syslog.svg @@ -1,26 +1,26 @@ - - - + + syslog - + syslog - - -syslog -     -[virtual table] - -logs -[] - + + +syslog +     +[virtual table] + +logs +[] + diff --git a/sample/sqlite/user_options.svg b/sample/sqlite/user_options.svg index de7facd8a..0a9b30b82 100644 --- a/sample/sqlite/user_options.svg +++ b/sample/sqlite/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[table] - -user_id -[INTEGER] - -show_email -[INTEGER] - -created -[NUMERIC] - -updated -[NUMERIC] - + + +user_options +     +[table] + +user_id +[INTEGER] + +show_email +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] + users - - -users -     -[table] - -id     -[INTEGER] - -username     -[TEXT] - -password     -[TEXT] - -email     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +users +     +[table] + +id +[INTEGER] + +username +[TEXT] + +password +[TEXT] + +email +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE diff --git a/sample/sqlite/users.svg b/sample/sqlite/users.svg index 64223c198..5904dd511 100644 --- a/sample/sqlite/users.svg +++ b/sample/sqlite/users.svg @@ -1,208 +1,208 @@ - - - + + users - + users - - -users -     -[table] - -id -[INTEGER] - -username -[TEXT] - -password -[TEXT] - -email -[TEXT] - -created -[NUMERIC] - -updated -[NUMERIC] - + + +users +     +[table] + +id +[INTEGER] + +username +[TEXT] + +password +[TEXT] + +email +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] + user_options - - -user_options -     -[table] - -user_id     -[INTEGER] - -show_email     -[INTEGER] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +user_options +     +[table] + +user_id +[INTEGER] + +show_email +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE posts - - -posts -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -title     -[TEXT] - -body     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +posts +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +title +[TEXT] + +body +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE comments - - -comments -     -[table] - -id     -[INTEGER] - -post_id     -[INTEGER] - -user_id     -[INTEGER] - -comment     -[TEXT] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comments +     +[table] + +id +[INTEGER] + +post_id +[INTEGER] + +user_id +[INTEGER] + +comment +[TEXT] + +created +[NUMERIC] + +updated +[NUMERIC] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE comment_stars - - -comment_stars -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -comment_post_id     -[INTEGER] - -comment_user_id     -[INTEGER] - -created     -[NUMERIC] - -updated     -[NUMERIC] + + +comment_stars +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +comment_post_id +[INTEGER] + +comment_user_id +[INTEGER] + +created +[NUMERIC] + +updated +[NUMERIC] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE logs - - -logs -     -[table] - -id     -[INTEGER] - -user_id     -[INTEGER] - -post_id     -[INTEGER] - -comment_id     -[INTEGER] - -comment_star_id     -[INTEGER] - -payload     -[TEXT] - -created     -[NUMERIC] + + +logs +     +[table] + +id +[INTEGER] + +user_id +[INTEGER] + +post_id +[INTEGER] + +comment_id +[INTEGER] + +comment_star_id +[INTEGER] + +payload +[TEXT] + +created +[NUMERIC] logs:user_id->users:id - - -logs->users + + +logs->users diff --git a/sample/viewpoints/CamelizeTable.svg b/sample/viewpoints/CamelizeTable.svg index d4a255f5c..a3a027ed8 100644 --- a/sample/viewpoints/CamelizeTable.svg +++ b/sample/viewpoints/CamelizeTable.svg @@ -1,29 +1,29 @@ - - - + + CamelizeTable - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/viewpoints/comment_stars.svg b/sample/viewpoints/comment_stars.svg index ca64597b4..faa10dd22 100644 --- a/sample/viewpoints/comment_stars.svg +++ b/sample/viewpoints/comment_stars.svg @@ -1,149 +1,149 @@ - - - + + comment_stars - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -comment_post_id -[bigint] - -comment_user_id -[int] - -created -[timestamp] - -updated -[timestamp] - + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] + comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/viewpoints/comments.svg b/sample/viewpoints/comments.svg index 655a53931..7e22f797c 100644 --- a/sample/viewpoints/comments.svg +++ b/sample/viewpoints/comments.svg @@ -1,186 +1,186 @@ - - - + + comments - + comments - - -comments -     -[BASE TABLE] - -id -[bigint] - -post_id -[bigint] - -user_id -[int] - -comment -[text] - -post_id_desc -[bigint] - -created -[datetime] - -updated -[datetime] - + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] + posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) diff --git a/sample/viewpoints/hyphen-table.svg b/sample/viewpoints/hyphen-table.svg index 3ffc46cac..223305bf2 100644 --- a/sample/viewpoints/hyphen-table.svg +++ b/sample/viewpoints/hyphen-table.svg @@ -1,32 +1,32 @@ - - - + + hyphen-table - + hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id -[bigint] - -hyphen-column -[text] - -created -[datetime] - + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] + diff --git a/sample/viewpoints/logs.svg b/sample/viewpoints/logs.svg index 6ea88a113..d2b9eb72a 100644 --- a/sample/viewpoints/logs.svg +++ b/sample/viewpoints/logs.svg @@ -1,186 +1,186 @@ - - - + + logs - + logs - - -logs -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -post_id -[bigint] - -comment_id -[bigint] - -comment_star_id -[bigint] - -payload -[text] - -created -[datetime] - + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] logs:user_id->users:id - - -logs->users + + +logs->users posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation diff --git a/sample/viewpoints/long_long_long_long_long_long_long_long_table_name.svg b/sample/viewpoints/long_long_long_long_long_long_long_long_table_name.svg index ae5169c4d..02e219e39 100644 --- a/sample/viewpoints/long_long_long_long_long_long_long_long_table_name.svg +++ b/sample/viewpoints/long_long_long_long_long_long_long_long_table_name.svg @@ -1,29 +1,29 @@ - - - + + long_long_long_long_long_long_long_long_table_name - + long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id -[bigint] - -created -[datetime] - + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] + diff --git a/sample/viewpoints/post_comments.svg b/sample/viewpoints/post_comments.svg index 1d625b0da..e0fb69b9f 100644 --- a/sample/viewpoints/post_comments.svg +++ b/sample/viewpoints/post_comments.svg @@ -1,44 +1,44 @@ - - - + + post_comments - + post_comments - - -post_comments -     -[VIEW] - -id -[bigint] - -title -[varchar(255)] - -post_user -[varchar(50)] - -comment -[text] - -comment_user -[varchar(50)] - -created -[datetime] - -updated -[datetime] - + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] + diff --git a/sample/viewpoints/posts.svg b/sample/viewpoints/posts.svg index fd047b403..dcf92d0e5 100644 --- a/sample/viewpoints/posts.svg +++ b/sample/viewpoints/posts.svg @@ -1,152 +1,152 @@ - - - + + posts - + posts - - -posts -     -[BASE TABLE] - -id -[bigint] - -user_id -[int] - -title -[varchar(255)] - -body -[text] - -post_type -[enum('public','private','draft')] - -created -[datetime] - -updated -[datetime] - + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation diff --git a/sample/viewpoints/schema.svg b/sample/viewpoints/schema.svg index d02ec02ba..1c4b4e5a9 100644 --- a/sample/viewpoints/schema.svg +++ b/sample/viewpoints/schema.svg @@ -1,326 +1,326 @@ - - - + + testdb - + CamelizeTable - - -CamelizeTable -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +CamelizeTable +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) hyphen-table - - -hyphen-table -     -[BASE TABLE] - -id     -[bigint] - -hyphen-column     -[text] - -created     -[datetime] + + +hyphen-table +     +[BASE TABLE] + +id +[bigint] + +hyphen-column +[text] + +created +[datetime] logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:user_id->users:id - - -logs->users + + +logs->users long_long_long_long_long_long_long_long_table_name - - -long_long_long_long_long_long_long_long_table_name -     -[BASE TABLE] - -id     -[bigint] - -created     -[datetime] + + +long_long_long_long_long_long_long_long_table_name +     +[BASE TABLE] + +id +[bigint] + +created +[datetime] post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/viewpoints/user_options.svg b/sample/viewpoints/user_options.svg index eef6f0049..aa9aa9ed2 100644 --- a/sample/viewpoints/user_options.svg +++ b/sample/viewpoints/user_options.svg @@ -1,69 +1,69 @@ - - - + + user_options - + user_options - - -user_options -     -[BASE TABLE] - -user_id -[int] - -show_email -[tinyint(1)] - -created -[timestamp] - -updated -[timestamp] - + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/viewpoints/users.svg b/sample/viewpoints/users.svg index c2309a316..24f9d3e1b 100644 --- a/sample/viewpoints/users.svg +++ b/sample/viewpoints/users.svg @@ -1,214 +1,214 @@ - - - + + users - + users - - -users -     -[BASE TABLE] - -id -[int] - -username -[varchar(50)] - -password -[varchar(50)] - -email -[varchar(355)] - -created -[timestamp] - -updated -[timestamp] - + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:user_id->users:id - - -logs->users + + +logs->users diff --git a/sample/viewpoints/viewpoint-0.svg b/sample/viewpoints/viewpoint-0.svg index 9964a7fea..0ba42da24 100644 --- a/sample/viewpoints/viewpoint-0.svg +++ b/sample/viewpoints/viewpoint-0.svg @@ -1,144 +1,144 @@ - - - + + Content - + comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) post_comments - - -post_comments -     -[VIEW] - -id     -[bigint] - -title     -[varchar(255)] - -post_user     -[varchar(50)] - -comment     -[text] - -comment_user     -[varchar(50)] - -created     -[datetime] - -updated     -[datetime] + + +post_comments +     +[VIEW] + +id +[bigint] + +title +[varchar(255)] + +post_user +[varchar(50)] + +comment +[text] + +comment_user +[varchar(50)] + +created +[datetime] + +updated +[datetime] diff --git a/sample/viewpoints/viewpoint-1.svg b/sample/viewpoints/viewpoint-1.svg index d6460c571..c0d19a844 100644 --- a/sample/viewpoints/viewpoint-1.svg +++ b/sample/viewpoints/viewpoint-1.svg @@ -1,121 +1,121 @@ - - - + + Ops - + logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] logs:post_id->posts:id - - -Additional Relation + + +Additional Relation users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] logs:user_id->users:id - - -logs->users + + +logs->users posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/viewpoints/viewpoint-2.svg b/sample/viewpoints/viewpoint-2.svg index 59aad0d24..5cba71c4c 100644 --- a/sample/viewpoints/viewpoint-2.svg +++ b/sample/viewpoints/viewpoint-2.svg @@ -1,253 +1,253 @@ - - - + + Around the users table - + cluster_group_0 - -Content + +Content comment_stars - - -comment_stars -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -comment_post_id     -[bigint] - -comment_user_id     -[int] - -created     -[timestamp] - -updated     -[timestamp] + + +comment_stars +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +comment_post_id +[bigint] + +comment_user_id +[int] + +created +[timestamp] + +updated +[timestamp] comments - - -comments -     -[BASE TABLE] - -id     -[bigint] - -post_id     -[bigint] - -user_id     -[int] - -comment     -[text] - -post_id_desc     -[bigint] - -created     -[datetime] - -updated     -[datetime] + + +comments +     +[BASE TABLE] + +id +[bigint] + +post_id +[bigint] + +user_id +[int] + +comment +[text] + +post_id_desc +[bigint] + +created +[datetime] + +updated +[datetime] comment_stars:comment_post_id->comments:post_id - - -FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) + + +FOREIGN KEY (comment_post_id, comment_user_id) REFERENCES comments (post_id, user_id) users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] comment_stars:comment_user_id->users:id - - -FOREIGN KEY (comment_user_id) REFERENCES users (id) + + +FOREIGN KEY (comment_user_id) REFERENCES users (id) posts - - -posts -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -title     -[varchar(255)] - -body     -[text] - -post_type     -[enum('public','private','draft')] - -created     -[datetime] - -updated     -[datetime] + + +posts +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +title +[varchar(255)] + +body +[text] + +post_type +[enum('public','private','draft')] + +created +[datetime] + +updated +[datetime] comments:post_id->posts:id - - -FOREIGN KEY (post_id) REFERENCES posts (id) + + +FOREIGN KEY (post_id) REFERENCES posts (id) comments:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) posts:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) logs - - -logs -     -[BASE TABLE] - -id     -[bigint] - -user_id     -[int] - -post_id     -[bigint] - -comment_id     -[bigint] - -comment_star_id     -[bigint] - -payload     -[text] - -created     -[datetime] + + +logs +     +[BASE TABLE] + +id +[bigint] + +user_id +[int] + +post_id +[bigint] + +comment_id +[bigint] + +comment_star_id +[bigint] + +payload +[text] + +created +[datetime] logs:comment_star_id->comment_stars:id - - -Additional Relation + + +Additional Relation logs:comment_id->comments:id - - -Additional Relation + + +Additional Relation logs:post_id->posts:id - - -Additional Relation + + +Additional Relation logs:user_id->users:id - - -logs->users + + +logs->users user_options - - -user_options -     -[BASE TABLE] - -user_id     -[int] - -show_email     -[tinyint(1)] - -created     -[timestamp] - -updated     -[timestamp] + + +user_options +     +[BASE TABLE] + +user_id +[int] + +show_email +[tinyint(1)] + +created +[timestamp] + +updated +[timestamp] user_options:user_id->users:id - - -FOREIGN KEY (user_id) REFERENCES users (id) + + +FOREIGN KEY (user_id) REFERENCES users (id) diff --git a/sample/viewpoints/viewpoint-3.svg b/sample/viewpoints/viewpoint-3.svg index 33eee558e..fbda002ea 100644 --- a/sample/viewpoints/viewpoint-3.svg +++ b/sample/viewpoints/viewpoint-3.svg @@ -1,40 +1,40 @@ - - - + + Secure data - + users - - -users -     -[BASE TABLE] - -id     -[int] - -username     -[varchar(50)] - -password     -[varchar(50)] - -email     -[varchar(355)] - -created     -[timestamp] - -updated     -[timestamp] + + +users +     +[BASE TABLE] + +id +[int] + +username +[varchar(50)] + +password +[varchar(50)] + +email +[varchar(355)] + +created +[timestamp] + +updated +[timestamp] diff --git a/testdata/dot_test_a.dot.golden b/testdata/dot_test_a.dot.golden index 2c1041dd8..358c44543 100644 --- a/testdata/dot_test_a.dot.golden +++ b/testdata/dot_test_a.dot.golden @@ -12,8 +12,8 @@ digraph "a" { >]; "b" [shape=none, label=< - - + +
b    []
b    [INTEGER]
b2    [TEXT]
b [INTEGER]
b2 [TEXT]
>]; // Relations diff --git a/testdata/dot_test_schema.dot.golden b/testdata/dot_test_schema.dot.golden index 2992e8fdf..a7eef4250 100644 --- a/testdata/dot_test_schema.dot.golden +++ b/testdata/dot_test_schema.dot.golden @@ -7,17 +7,17 @@ digraph "testschema" { // Tables "a" [shape=none, label=< - - + +
a    []
a    [INTEGER]
a2    [TEXT]
a [INTEGER]
a2 [TEXT]
>]; "b" [shape=none, label=< - - + +
b    []
b    [INTEGER]
b2    [TEXT]
b [INTEGER]
b2 [TEXT]
>]; "view" [shape=none, label=< - +
view    [VIEW]
view_column    [INTEGER]
view_column [INTEGER]
>]; // Relations diff --git a/testdata/dot_test_schema.dot.hide_not_related_column.golden b/testdata/dot_test_schema.dot.hide_not_related_column.golden index c1f85b5a1..50e40bdcf 100644 --- a/testdata/dot_test_schema.dot.hide_not_related_column.golden +++ b/testdata/dot_test_schema.dot.hide_not_related_column.golden @@ -7,11 +7,11 @@ digraph "testschema" { // Tables "a" [shape=none, label=< - +
a    []
a    [INTEGER]
a [INTEGER]
>]; "b" [shape=none, label=< - +
b    []
b    [INTEGER]
b [INTEGER]
>]; "view" [shape=none, label=< diff --git a/testdata/dot_test_schema.dot.hidedef.golden b/testdata/dot_test_schema.dot.hidedef.golden index 58946a425..c71f18efd 100644 --- a/testdata/dot_test_schema.dot.hidedef.golden +++ b/testdata/dot_test_schema.dot.hidedef.golden @@ -7,17 +7,17 @@ digraph "testschema" { // Tables "a" [shape=none, label=<
view    [VIEW]
- - + +
a    []
a    [INTEGER]
a2    [TEXT]
a [INTEGER]
a2 [TEXT]
>]; "b" [shape=none, label=< - - + +
b    []
b    [INTEGER]
b2    [TEXT]
b [INTEGER]
b2 [TEXT]
>]; "view" [shape=none, label=< - +
view    [VIEW]
view_column    [INTEGER]
view_column [INTEGER]
>]; // Relations diff --git a/testdata/dot_test_viewpoint_0.dot.golden b/testdata/dot_test_viewpoint_0.dot.golden index 3bc81c9cc..3a328c9fb 100644 --- a/testdata/dot_test_viewpoint_0.dot.golden +++ b/testdata/dot_test_viewpoint_0.dot.golden @@ -7,13 +7,13 @@ digraph "table a b" { // Tables "a" [shape=none, label=< - - + +
a    []
a    [INTEGER]
a2    [TEXT]
a [INTEGER]
a2 [TEXT]
>]; "b" [shape=none, label=< - - + +
b    []
b    [INTEGER]
b2    [TEXT]
b [INTEGER]
b2 [TEXT]
>]; // Relations diff --git a/testdata/dot_test_viewpoint_1.dot.golden b/testdata/dot_test_viewpoint_1.dot.golden index 6cf9888f0..9d0e966e7 100644 --- a/testdata/dot_test_viewpoint_1.dot.golden +++ b/testdata/dot_test_viewpoint_1.dot.golden @@ -7,8 +7,8 @@ digraph "label blue" { // Tables "a" [shape=none, label=< - - + +
a    []
a    [INTEGER]
a2    [TEXT]
a [INTEGER]
a2 [TEXT]
>]; // Relations diff --git a/testdata/dot_test_viewpoint_2.dot.golden b/testdata/dot_test_viewpoint_2.dot.golden index 32cb7e7e5..595faaf84 100644 --- a/testdata/dot_test_viewpoint_2.dot.golden +++ b/testdata/dot_test_viewpoint_2.dot.golden @@ -12,14 +12,14 @@ digraph "label green" { fillcolor = "#FFFFFF00" "b" [shape=none, label=< - - + +
b    []
b    [INTEGER]
b2    [TEXT]
b [INTEGER]
b2 [TEXT]
>]; } "a" [shape=none, label=< - - + +
a    []
a    [INTEGER]
a2    [TEXT]
a [INTEGER]
a2 [TEXT]
>]; // Relations diff --git a/testdata/dot_test_viewpoint_3.dot.golden b/testdata/dot_test_viewpoint_3.dot.golden index acc137393..d4a130b90 100644 --- a/testdata/dot_test_viewpoint_3.dot.golden +++ b/testdata/dot_test_viewpoint_3.dot.golden @@ -7,13 +7,13 @@ digraph "table a label red" { // Tables "a" [shape=none, label=< - - + +
a    []
a    [INTEGER]
a2    [TEXT]
a [INTEGER]
a2 [TEXT]
>]; "b" [shape=none, label=< - - + +
b    []
b    [INTEGER]
b2    [TEXT]
b [INTEGER]
b2 [TEXT]
>]; // Relations diff --git a/testdata/svg_test_a.svg.golden b/testdata/svg_test_a.svg.golden index 7a89eb8e0..7b1ef66b6 100644 --- a/testdata/svg_test_a.svg.golden +++ b/testdata/svg_test_a.svg.golden @@ -1,51 +1,51 @@ - - - + + a - + a - - -a -     -[] - -a -[INTEGER] - -a2 -[TEXT] - + + +a +     +[] + +a +[INTEGER] + +a2 +[TEXT] + b - - -b -     -[] - -b     -[INTEGER] - -b2     -[TEXT] + + +b +     +[] + +b +[INTEGER] + +b2 +[TEXT] b:b->a:a - - -FOREIGN KEY (b) REFERENCES a(a) + + +FOREIGN KEY (b) REFERENCES a(a) diff --git a/testdata/svg_test_schema.svg.golden b/testdata/svg_test_schema.svg.golden index dc3102b4d..998ae5ee8 100644 --- a/testdata/svg_test_schema.svg.golden +++ b/testdata/svg_test_schema.svg.golden @@ -1,62 +1,62 @@ - - - + + testschema - + a - - -a -     -[] - -a     -[INTEGER] - -a2     -[TEXT] + + +a +     +[] + +a +[INTEGER] + +a2 +[TEXT] b - - -b -     -[] - -b     -[INTEGER] - -b2     -[TEXT] + + +b +     +[] + +b +[INTEGER] + +b2 +[TEXT] b:b->a:a - - -FOREIGN KEY (b) REFERENCES a(a) + + +FOREIGN KEY (b) REFERENCES a(a) view - - -view -     -[VIEW] - -view_column     -[INTEGER] + + +view +     +[VIEW] + +view_column +[INTEGER]