This repository was archived by the owner on May 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 18 files changed +58
-71
lines changed Expand file tree Collapse file tree 18 files changed +58
-71
lines changed Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/dialect/entsql"
8
6
"entgo.io/ent/schema/edge"
@@ -26,10 +24,10 @@ func (Approval) Fields() []ent.Field {
26
24
).
27
25
Default ("pending" ),
28
26
field .Time ("created_at" ).
29
- Default (time . Now ),
27
+ Default (nowUTC ),
30
28
field .Time ("updated_at" ).
31
- Default (time . Now ).
32
- UpdateDefault (time . Now ),
29
+ Default (nowUTC ).
30
+ UpdateDefault (nowUTC ),
33
31
// Edges
34
32
field .Int64 ("user_id" ),
35
33
field .Int ("deployment_id" ),
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/schema/edge"
8
6
"entgo.io/ent/schema/field"
@@ -29,10 +27,10 @@ func (Callback) Fields() []ent.Field {
29
27
"unlock" ,
30
28
),
31
29
field .Time ("created_at" ).
32
- Default (time . Now ),
30
+ Default (nowUTC ),
33
31
field .Time ("updated_at" ).
34
- Default (time . Now ).
35
- UpdateDefault (time . Now ),
32
+ Default (nowUTC ).
33
+ UpdateDefault (nowUTC ),
36
34
field .Int64 ("repo_id" ),
37
35
}
38
36
}
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/schema/edge"
8
6
"entgo.io/ent/schema/field"
@@ -25,10 +23,10 @@ func (ChatUser) Fields() []ent.Field {
25
23
field .String ("bot_token" ).
26
24
Sensitive (),
27
25
field .Time ("created_at" ).
28
- Default (time . Now ),
26
+ Default (nowUTC ),
29
27
field .Time ("updated_at" ).
30
- Default (time . Now ).
31
- UpdateDefault (time . Now ),
28
+ Default (nowUTC ).
29
+ UpdateDefault (nowUTC ),
32
30
field .Int64 ("user_id" ),
33
31
}
34
32
}
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/dialect/entsql"
8
6
"entgo.io/ent/schema/edge"
@@ -56,10 +54,10 @@ func (Deployment) Fields() []ent.Field {
56
54
field .Int ("required_approval_count" ).
57
55
Default (0 ),
58
56
field .Time ("created_at" ).
59
- Default (time . Now ),
57
+ Default (nowUTC ),
60
58
field .Time ("updated_at" ).
61
- Default (time . Now ).
62
- UpdateDefault (time . Now ),
59
+ Default (nowUTC ).
60
+ UpdateDefault (nowUTC ),
63
61
// Edges
64
62
field .Int64 ("user_id" ),
65
63
field .Int64 ("repo_id" ),
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/schema/edge"
8
6
"entgo.io/ent/schema/field"
@@ -31,10 +29,10 @@ func (DeploymentStatistics) Fields() []ent.Field {
31
29
field .Int ("lead_time_seconds" ).
32
30
Default (0 ),
33
31
field .Time ("created_at" ).
34
- Default (time . Now ),
32
+ Default (nowUTC ),
35
33
field .Time ("updated_at" ).
36
- Default (time . Now ).
37
- UpdateDefault (time . Now ),
34
+ Default (nowUTC ).
35
+ UpdateDefault (nowUTC ),
38
36
field .Int64 ("repo_id" ),
39
37
}
40
38
}
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/schema/edge"
8
6
"entgo.io/ent/schema/field"
@@ -22,10 +20,10 @@ func (DeploymentStatus) Fields() []ent.Field {
22
20
field .String ("log_url" ).
23
21
Optional (),
24
22
field .Time ("created_at" ).
25
- Default (time . Now ),
23
+ Default (nowUTC ),
26
24
field .Time ("updated_at" ).
27
- Default (time . Now ).
28
- UpdateDefault (time . Now ),
25
+ Default (nowUTC ).
26
+ UpdateDefault (nowUTC ),
29
27
30
28
// edges
31
29
field .Int ("deployment_id" ),
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/schema/edge"
8
6
"entgo.io/ent/schema/field"
@@ -29,7 +27,7 @@ func (Event) Fields() []ent.Field {
29
27
"deleted" ,
30
28
),
31
29
field .Time ("created_at" ).
32
- Default (time . Now ),
30
+ Default (nowUTC ),
33
31
field .Int ("deployment_id" ).
34
32
Optional (),
35
33
field .Int ("approval_id" ).
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/schema/edge"
8
6
"entgo.io/ent/schema/field"
@@ -22,7 +20,7 @@ func (Lock) Fields() []ent.Field {
22
20
Optional ().
23
21
Nillable (),
24
22
field .Time ("created_at" ).
25
- Default (time . Now ),
23
+ Default (nowUTC ),
26
24
// Edges
27
25
field .Int64 ("user_id" ),
28
26
field .Int64 ("repo_id" ),
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/dialect"
8
6
"entgo.io/ent/schema/edge"
@@ -31,10 +29,10 @@ func (Perm) Fields() []ent.Field {
31
29
dialect .MySQL : "timestamp(6)" ,
32
30
}),
33
31
field .Time ("created_at" ).
34
- Default (time . Now ),
32
+ Default (nowUTC ),
35
33
field .Time ("updated_at" ).
36
- Default (time . Now ).
37
- UpdateDefault (time . Now ),
34
+ Default (nowUTC ).
35
+ UpdateDefault (nowUTC ),
38
36
// Edges
39
37
field .Int64 ("user_id" ),
40
38
field .Int64 ("repo_id" ),
Original file line number Diff line number Diff line change 1
1
package schema
2
2
3
3
import (
4
- "time"
5
-
6
4
"entgo.io/ent"
7
5
"entgo.io/ent/dialect/entsql"
8
6
"entgo.io/ent/schema/edge"
@@ -30,10 +28,10 @@ func (Repo) Fields() []ent.Field {
30
28
field .Int64 ("webhook_id" ).
31
29
Optional (),
32
30
field .Time ("created_at" ).
33
- Default (time . Now ),
31
+ Default (nowUTC ),
34
32
field .Time ("updated_at" ).
35
- Default (time . Now ).
36
- UpdateDefault (time . Now ),
33
+ Default (nowUTC ).
34
+ UpdateDefault (nowUTC ),
37
35
// Denormalization to sort with deployment.
38
36
field .Time ("latest_deployed_at" ).
39
37
Optional (),
You can’t perform that action at this time.
0 commit comments