entc/gen: fix name clash in entc template when entity name has initials as tx (#2633)

This commit is contained in:
hax10
2022-06-10 01:39:46 +08:00
committed by GitHub
parent fd955654a0
commit e6152856b1
115 changed files with 231 additions and 231 deletions

View File

@@ -114,11 +114,11 @@ func (c *Comment) Update() *CommentUpdateOne {
// Unwrap unwraps the Comment entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (c *Comment) Unwrap() *Comment {
tx, ok := c.config.driver.(*txDriver)
_tx, ok := c.config.driver.(*txDriver)
if !ok {
panic("ent: Comment is not a transactional entity")
}
c.config.driver = tx.drv
c.config.driver = _tx.drv
return c
}

View File

@@ -130,11 +130,11 @@ func (po *Post) Update() *PostUpdateOne {
// Unwrap unwraps the Post entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (po *Post) Unwrap() *Post {
tx, ok := po.config.driver.(*txDriver)
_tx, ok := po.config.driver.(*txDriver)
if !ok {
panic("ent: Post is not a transactional entity")
}
po.config.driver = tx.drv
po.config.driver = _tx.drv
return po
}

View File

@@ -100,11 +100,11 @@ func (u *User) Update() *UserUpdateOne {
// Unwrap unwraps the User entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (u *User) Unwrap() *User {
tx, ok := u.config.driver.(*txDriver)
_tx, ok := u.config.driver.(*txDriver)
if !ok {
panic("ent: User is not a transactional entity")
}
u.config.driver = tx.drv
u.config.driver = _tx.drv
return u
}