Skip to content

Commit 65c15af

Browse files
authored
map time.time to timestamp (#549)
1 parent 10d2889 commit 65c15af

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

genny/fizz/ctable/create_table.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func fizzColType(s string) string {
7272
switch strings.ToLower(s) {
7373
case "int":
7474
return "integer"
75-
case "time", "datetime":
75+
case "time.time", "time", "datetime":
7676
return "timestamp"
7777
case "uuid.uuid", "uuid":
7878
return "uuid"

genny/fizz/ctable/create_table_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
func Test_New(t *testing.T) {
1212
r := require.New(t)
1313

14-
ats, err := attrs.ParseArgs("id:uuid", "created_at:timestamp", "updated_at:timestamp", "name", "description:text", "age:int", "bar:nulls.String")
14+
ats, err := attrs.ParseArgs("id:uuid", "created_at:timestamp", "updated_at:timestamp", "name", "description:text", "age:int", "bar:nulls.String", "started_at:time.Time", "finished_at:nulls.Time")
1515
r.NoError(err)
1616

1717
cases := []struct {
@@ -51,6 +51,8 @@ func Test_New(t *testing.T) {
5151
t.Column("description", "text", {})
5252
t.Column("age", "integer", {})
5353
t.Column("bar", "string", {null: true})
54+
t.Column("started_at", "timestamp", {})
55+
t.Column("finished_at", "timestamp", {null: true})
5456
t.Timestamps()
5557
}`,
5658
},

0 commit comments

Comments
 (0)