mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
ent/field: add default value for time
Reviewed By: alexsn Differential Revision: D16890453 fbshipit-source-id: 362ae9e9666c523bdcce16503441565b6279ff08
This commit is contained in:
committed by
Facebook Github Bot
parent
51a4dd4412
commit
079ba191e3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user