mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/entsql: add helper function for creating table annotation (#3816)
This commit is contained in:
@@ -146,6 +146,20 @@ func (Annotation) Name() string {
|
||||
return "EntSQL"
|
||||
}
|
||||
|
||||
// The Table option allows overriding the default table
|
||||
// name that is generated by ent. For example:
|
||||
//
|
||||
// func (T) Annotations() []schema.Annotation {
|
||||
// return []schema.Annotation{
|
||||
// entsql.Table("Users"),
|
||||
// }
|
||||
// }
|
||||
func Table(t string) *Annotation {
|
||||
return &Annotation{
|
||||
Table: t,
|
||||
}
|
||||
}
|
||||
|
||||
// Check allows injecting custom "DDL" for setting an unnamed "CHECK" clause in "CREATE TABLE".
|
||||
//
|
||||
// entsql.Annotation{
|
||||
|
||||
Reference in New Issue
Block a user