mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
dialect/sql/schema: remove Go 1.13 string features
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/207 Reviewed By: xjtian Differential Revision: D18743529 fbshipit-source-id: f6420e9ca233e0ce6f9254b4f85d1711ee4d4bfa
This commit is contained in:
committed by
Facebook Github Bot
parent
5610d0ade9
commit
f98dbbc440
@@ -224,7 +224,7 @@ func (c *Column) defaultValue(b *sql.ColumnBuilder) {
|
||||
attr += strconv.FormatBool(v)
|
||||
case string:
|
||||
// escape single quote by replacing each with 2.
|
||||
attr += fmt.Sprintf("'%s'", strings.ReplaceAll(v, "'", "''"))
|
||||
attr += fmt.Sprintf("'%s'", strings.Replace(v, "'", "''", -1))
|
||||
default:
|
||||
attr += fmt.Sprint(v)
|
||||
}
|
||||
@@ -328,7 +328,7 @@ func (r ReferenceOption) ConstName() string {
|
||||
if r == NoAction {
|
||||
return ""
|
||||
}
|
||||
return strings.ReplaceAll(strings.Title(strings.ToLower(string(r))), " ", "")
|
||||
return strings.Replace(strings.Title(strings.ToLower(string(r))), " ", "", -1)
|
||||
}
|
||||
|
||||
// Index definition for table index.
|
||||
|
||||
Reference in New Issue
Block a user