Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit e4c11b3

Browse files
author
Noah Hanjun Lee
authored
Fix the type of synched_at for mysql (#146)
1 parent 793f710 commit e4c11b3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ent/migrate/schema.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ent/schema/perm.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"time"
55

66
"entgo.io/ent"
7+
"entgo.io/ent/dialect"
78
"entgo.io/ent/schema/edge"
89
"entgo.io/ent/schema/field"
910
"entgo.io/ent/schema/index"
@@ -25,7 +26,10 @@ func (Perm) Fields() []ent.Field {
2526
).
2627
Default("read"),
2728
field.Time("synced_at").
28-
Optional(),
29+
Optional().
30+
SchemaType(map[string]string{
31+
dialect.MySQL: "timestamp(6)",
32+
}),
2933
field.Time("created_at").
3034
Default(time.Now),
3135
field.Time("updated_at").

0 commit comments

Comments
 (0)