ent/field: add default value for time

Reviewed By: alexsn

Differential Revision: D16890453

fbshipit-source-id: 362ae9e9666c523bdcce16503441565b6279ff08
This commit is contained in:
Ariel Mashraki
2019-08-19 04:20:19 -07:00
committed by Facebook Github Bot
parent 51a4dd4412
commit 079ba191e3
19 changed files with 294 additions and 43 deletions

View File

@@ -116,6 +116,7 @@ var tests = []func(*testing.T, *ent.Client){
M2MSelfRef,
M2MSameType,
M2MTwoTypes,
DefaultValue,
}
func Sanity(t *testing.T, client *ent.Client) {
@@ -1836,6 +1837,12 @@ func Tx(t *testing.T, client *ent.Client) {
require.NoError(tx.Rollback())
}
func DefaultValue(t *testing.T, client *ent.Client) {
ctx := context.Background()
c1 := client.Card.Create().SetNumber("102030").SaveX(ctx)
require.False(t, c1.CreatedAt.IsZero())
}
func drop(t *testing.T, client *ent.Client) {
t.Log("drop data from database")
ctx := context.Background()