Update 1602644950000_migrate.go
This commit is contained in:
1 parent
d12b1b7384
commit
7a0fff117b
1 file changed
+14
@@ -20,6 +20,20 @@ func _1602644950000Test(db *gorm.DB, version string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
list2 := []models.CasbinRule{
|
||||||
|
{PType: "p", V0: "admin", V1: "/api/v1/config", V2: "GET"},
|
||||||
|
}
|
||||||
|
err = tx.Create(list2).Error
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
menu := models.Menu{MenuId: 86, Path: "/api/v1/config"}
|
||||||
|
err = tx.Model(&menu).Where("menu_id = ?", 86).Update("Path", "/api/v1/config").Error
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return db.Create(&common.Migration{
|
return db.Create(&common.Migration{
|
||||||
Version: version,
|
Version: version,
|
||||||
}).Error
|
}).Error
|
||||||
|
|||||||
Reference in new issue
Block a user