Files
ent/examples/m2mbidi
Alex Snast dacc568413 ent/entc: corrently reference default value on migrate generation
Summary:
Migration incorrectly generated field default value on storage key inclusion.

Example Field:
```
field.String("tenant").
  StorageKey("organization").
  Default("fb-test"),
```
Generated default of:
```
// DefaultTenant holds the default value on creation for the tenant field.
DefaultTenant = descTenant.Default.(string)
```
But migration references non existent default (storage key is used):
```
{Name: "organization", Type: field.TypeString, Default: user.DefaultOrganization},
```

Reviewed By: a8m

Differential Revision: D17578898

fbshipit-source-id: afca92ac3f34c16100c868a10d0a480139bf4262
2019-09-25 13:51:45 -07:00
..
2019-08-26 08:02:12 -07:00

User-Friends Bidirectional M2M Relation

In this user-friends example, we have a symmetric M2M relation named friends. Each user can have many friends. If user A becomes a friend of B, B is also a friend of A.

Generate Assets

go generate ./...