add comment
This commit is contained in:
parent
2f228b606c
commit
6537d7ca8d
@ -30,8 +30,8 @@ func (db *DB) AutoMigrate(dst ...interface{}) error {
|
|||||||
|
|
||||||
// ViewOption view option
|
// ViewOption view option
|
||||||
type ViewOption struct {
|
type ViewOption struct {
|
||||||
Replace bool
|
Replace bool // CREATE [ OR REPLACE ]
|
||||||
CheckOption string
|
CheckOption string // WITH [ CASCADED | LOCAL ] CHECK OPTION
|
||||||
Query *DB
|
Query *DB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,9 +571,7 @@ func (m Migrator) CreateView(name string, option gorm.ViewOption) error {
|
|||||||
m.DB.Statement.AddVar(sql, option.Query)
|
m.DB.Statement.AddVar(sql, option.Query)
|
||||||
|
|
||||||
if option.CheckOption != "" {
|
if option.CheckOption != "" {
|
||||||
sql.WriteString(" WITH ")
|
|
||||||
sql.WriteString(option.CheckOption)
|
sql.WriteString(option.CheckOption)
|
||||||
sql.WriteString(" CHECK OPTION")
|
|
||||||
}
|
}
|
||||||
return m.DB.Exec(sql.String()).Error
|
return m.DB.Exec(sql.String()).Error
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user