mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
修复初始化数据时问题
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
@@ -43,7 +41,7 @@ func _1599190683670Test(db *gorm.DB, version string) error {
|
||||
}
|
||||
|
||||
list6 := []models.SysRole{
|
||||
{1, "系统管理员", "2", "admin", 1, "", "1", "", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, "", []int{}, []int{}},
|
||||
{1, "系统管理员", "2", "admin", 1, "", "1", "0", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, "", []int{}, []int{}},
|
||||
}
|
||||
|
||||
list7 := []DictType{
|
||||
@@ -71,7 +69,7 @@ func _1599190683670Test(db *gorm.DB, version string) error {
|
||||
},
|
||||
UserId: 1,
|
||||
Username: "admin",
|
||||
Password: "$2a$10$cKFFTCzGOvaIHHJY2K45Zuwt8TD6oPzYi4s5MzYIBAWCLL6ZhouP2",
|
||||
Password: "123456",
|
||||
NickName: "zhangwj",
|
||||
Phone: "13818888888",
|
||||
RoleId: 1,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
@@ -22,7 +20,23 @@ func _1613783303115Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
//修改字段类型
|
||||
err := tx.Migrator().AlterColumn(&system.SysDictType{}, "create_by")
|
||||
err := tx.Model(&system.SysDictType{}).Select("create_by").Not("create_by > 0").Update("create_by", 0).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(&system.SysDictType{}).Select("update_by").Not("update_by > 0").Update("update_by", 0).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(&system.SysDictData{}).Select("create_by").Not("create_by > 0").Update("create_by", 0).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(&system.SysDictData{}).Select("update_by").Not("update_by > 0").Update("update_by", 0).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysDictType{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// +build ignore
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user