mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
entc/gen: initial support for user-defined ids
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/162 Reviewed By: alexsn Differential Revision: D18485086 fbshipit-source-id: 9bb6ccff592bc0cb8b218625161ed492f67bc170
This commit is contained in:
committed by
Facebook Github Bot
parent
e161ecc29c
commit
d9da7243f9
@@ -331,8 +331,9 @@ func (g *Graph) Tables() (all []*schema.Table) {
|
||||
})
|
||||
case M2M:
|
||||
t1, t2 := tables[n.Table()], tables[e.Type.Table()]
|
||||
c1 := &schema.Column{Name: e.Rel.Columns[0], Type: field.TypeInt}
|
||||
c2 := &schema.Column{Name: e.Rel.Columns[1], Type: field.TypeInt}
|
||||
fk1, fk2 := n.ID, e.Type.ID
|
||||
c1 := &schema.Column{Name: e.Rel.Columns[0], Type: fk1.Type.Type}
|
||||
c2 := &schema.Column{Name: e.Rel.Columns[1], Type: fk2.Type.Type}
|
||||
all = append(all, &schema.Table{
|
||||
Name: e.Rel.Table,
|
||||
Columns: []*schema.Column{c1, c2},
|
||||
|
||||
Reference in New Issue
Block a user