Skip to content

Commit ca8e206

Browse files
committed
Revert "Make timestamp to match MySQL's timestamp type."
This reverts commit abae1e9.
1 parent 708c048 commit ca8e206

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

fizz/translators/mysql.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ func (p *MySQL) colType(c fizz.Column) string {
169169
return fmt.Sprintf("VARCHAR (%s)", s)
170170
case "uuid":
171171
return "char(36)"
172-
case "timestamp":
173-
return "TIMESTAMP"
174-
case "time", "datetime":
172+
case "timestamp", "time", "datetime":
175173
return "DATETIME"
176174
default:
177175
return c.ColType

fizz/translators/mysql_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ permissions text,
7474
age integer DEFAULT 40,
7575
company_id char(36) NOT NULL DEFAULT 'test',
7676
uuid char(36) NOT NULL,
77-
deleted_at TIMESTAMP NOT NULL,
78-
expired_at DATETIME NOT NULL,
7977
created_at DATETIME NOT NULL,
8078
updated_at DATETIME NOT NULL,
8179
PRIMARY KEY(uuid)
@@ -90,8 +88,6 @@ PRIMARY KEY(uuid)
9088
t.Column("age", "integer", {"null": true, "default": 40})
9189
t.Column("company_id", "uuid", {"default_raw": "'test'"})
9290
t.Column("uuid", "uuid", {"primary": true})
93-
t.Column("deleted_at", "timestamp")
94-
t.Column("expired_at", "datetime")
9591
})
9692
`, myt)
9793
r.Equal(ddl, res)

0 commit comments

Comments
 (0)