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-09-22 01:38:08 -07:00
2019-08-29 23:22:44 -07:00
2019-06-17 08:23:39 -07:00
2019-08-26 08:02:12 -07:00

ent - An Entity Framework For Go

Simple, yet powerful ORM for modeling and querying data.

  • Schema As Code - model any graph schema as Go objects.
  • Easily Traverse Any Graph - run queries, aggregations and traverse any graph structure easily.
  • Statically Typed And Explicit API - 100% statically typed and explicit API using code generation.
  • Multi Storage Driver - supports MySQL, SQLite and Gremlin.

Installation

go get github.com/facebookincubator/ent/entc/cmd/entc

Docs

The documentation for developing and using ent is avaliable at: https://entgo.io

Join the ent Community

See the CONTRIBUTING file for how to help out.

License

ent is licensed under Apache 2.0 as found in the LICENSE file.

Description
An entity framework for Go
Readme Apache-2.0 61 MiB
Languages
Go 100%