entc/gen: change name format for edge fks (#286)

* entc/gen: change name format for edge fks

* dialect/sql/schema: add fixture support for mysql and postgres

* sql/dialect: merge fkcolumn queries to one for the 2 dialects
This commit is contained in:
Ariel Mashraki
2020-02-03 15:41:55 +02:00
committed by GitHub
parent c70f1017e3
commit b4255998bf
113 changed files with 1082 additions and 431 deletions

View File

@@ -19,11 +19,11 @@ const (
// ParentTable is the table the holds the parent relation/edge.
ParentTable = "nodes"
// ParentColumn is the table column denoting the parent relation/edge.
ParentColumn = "parent_id"
ParentColumn = "node_children"
// ChildrenTable is the table the holds the children relation/edge.
ChildrenTable = "nodes"
// ChildrenColumn is the table column denoting the children relation/edge.
ChildrenColumn = "parent_id"
ChildrenColumn = "node_children"
)
// Columns holds all SQL columns for node fields.
@@ -34,5 +34,5 @@ var Columns = []string{
// ForeignKeys holds the SQL foreign-keys that are owned by the Node type.
var ForeignKeys = []string{
"parent_id",
"node_children",
}