You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
744 B
32 lines
744 B
package system
|
|
|
|
import (
|
|
"ims/app/models"
|
|
"ims/util/db/dts"
|
|
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var m202409291240_02_create_super_account = gormigrate.Migration{
|
|
ID: "202409291240_02_create_super_account",
|
|
Migrate: func(tx *gorm.DB) error {
|
|
return tx.Model(&models.Account{}).FirstOrCreate(
|
|
&models.Account{
|
|
ID: 1,
|
|
Nickname: "超级管理员",
|
|
AvatarUrl: "https://gravatar.com/userimage/256315286/98080c737d1d5c9f4d131266245ea8c9.jpeg?size=256",
|
|
Username: "admin",
|
|
RawPassword: "111111",
|
|
Email: dts.NullString{
|
|
String: "hupeh@qq.com",
|
|
Valid: true,
|
|
},
|
|
},
|
|
models.Account{ID: 1},
|
|
).Error
|
|
},
|
|
Rollback: func(tx *gorm.DB) error {
|
|
return nil
|
|
},
|
|
}
|
|
|