set default mysql table collation to utf8mb4_bin (#1295)

Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1295

Pull Request resolved: https://github.com/facebookincubator/ent/pull/13

See [Case Sensitivity in String Searches](https://dev.mysql.com/doc/refman/5.7/en/case-sensitivity.html)

Reviewed By: a8m

Differential Revision: D16782072

fbshipit-source-id: f2a836e580757f0e956a444c3fdf93c502723098
This commit is contained in:
Alex Snast
2019-08-13 02:09:45 -07:00
committed by Facebook Github Bot
parent 108affa8dd
commit c0deedcf48
2 changed files with 13 additions and 3 deletions

View File

@@ -77,9 +77,9 @@ func (t *Table) MySQL(version string) *sql.TableBuilder {
for _, pk := range t.PrimaryKey {
b.PrimaryKey(pk.Name)
}
// default character set to MySQL table.
// columns can be override using the "Charset" field.
b.Charset("utf8mb4")
// default charset / collation on MySQL table.
// columns can be override using the Charset / Collate fields.
b.Charset("utf8mb4").Collate("utf8mb4_bin")
return b
}