Skip to content

Commit

Permalink
Revert "Make timestamp to match MySQL's timestamp type."
Browse files Browse the repository at this point in the history
This reverts commit abae1e9.
  • Loading branch information
markbates committed Nov 3, 2017
1 parent 708c048 commit ca8e206
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions fizz/translators/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ func (p *MySQL) colType(c fizz.Column) string {
return fmt.Sprintf("VARCHAR (%s)", s)
case "uuid":
return "char(36)"
case "timestamp":
return "TIMESTAMP"
case "time", "datetime":
case "timestamp", "time", "datetime":
return "DATETIME"
default:
return c.ColType
Expand Down
4 changes: 0 additions & 4 deletions fizz/translators/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ permissions text,
age integer DEFAULT 40,
company_id char(36) NOT NULL DEFAULT 'test',
uuid char(36) NOT NULL,
deleted_at TIMESTAMP NOT NULL,
expired_at DATETIME NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY(uuid)
Expand All @@ -90,8 +88,6 @@ PRIMARY KEY(uuid)
t.Column("age", "integer", {"null": true, "default": 40})
t.Column("company_id", "uuid", {"default_raw": "'test'"})
t.Column("uuid", "uuid", {"primary": true})
t.Column("deleted_at", "timestamp")
t.Column("expired_at", "datetime")
})
`, myt)
r.Equal(ddl, res)
Expand Down

0 comments on commit ca8e206

Please sign in to comment.