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
|
||||
type ViewOption struct {
|
||||
Replace bool
|
||||
CheckOption string
|
||||
Replace bool // CREATE [ OR REPLACE ]
|
||||
CheckOption string // WITH [ CASCADED | LOCAL ] CHECK OPTION
|
||||
Query *DB
|
||||
}
|
||||
|
||||
|
@ -571,9 +571,7 @@ func (m Migrator) CreateView(name string, option gorm.ViewOption) error {
|
||||
m.DB.Statement.AddVar(sql, option.Query)
|
||||
|
||||
if option.CheckOption != "" {
|
||||
sql.WriteString(" WITH ")
|
||||
sql.WriteString(option.CheckOption)
|
||||
sql.WriteString(" CHECK OPTION")
|
||||
}
|
||||
return m.DB.Exec(sql.String()).Error
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user