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.
|
|
package system
import ( adapter "github.com/casbin/gorm-adapter/v3" "github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/model/example" "github.com/flipped-aurora/gin-vue-admin/server/model/system" "github.com/flipped-aurora/gin-vue-admin/server/model/system/request" )
type InitDBService struct{}
// InitDB 创建数据库并初始化 总入口
// Author [piexlmax](https://github.com/piexlmax)
// Author [SliverHorn](https://github.com/SliverHorn)
// Author [songzhibin97](https://github.com/songzhibin97)
func (initDBService *InitDBService) InitDB(conf request.InitDB) error { switch conf.DBType { case "mysql": return initDBService.initMsqlDB(conf) case "pgsql": return initDBService.initPgsqlDB(conf) default: return initDBService.initMsqlDB(conf) } }
// initTables 初始化表
// Author SliverHorn
func (initDBService *InitDBService) initTables() error { return global.GVA_DB.AutoMigrate( system.SysApi{}, system.SysUser{}, system.SysBaseMenu{}, system.SysAuthority{}, system.JwtBlacklist{}, system.SysDictionary{}, system.SysAutoCodeHistory{}, system.SysOperationRecord{}, system.SysDictionaryDetail{}, system.SysBaseMenuParameter{},
adapter.CasbinRule{},
example.ExaFile{}, example.ExaCustomer{}, example.ExaFileChunk{}, example.ExaFileUploadAndDownload{}, )
}
|