feat:完善项目信息
This commit is contained in:
@ -8,13 +8,13 @@ import (
|
||||
)
|
||||
|
||||
type Mysql struct {
|
||||
User, Password, Host string
|
||||
Port int
|
||||
DBName, Parameters string
|
||||
Host, Username, Password string
|
||||
Port int
|
||||
Database, Parameters string
|
||||
}
|
||||
|
||||
func (this *Mysql) DSN() gorm.Dialector {
|
||||
return mysql.Open(fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?%s",
|
||||
this.User, this.Password, this.Host, this.Port, this.DBName, this.Parameters,
|
||||
this.Username, this.Password, this.Host, this.Port, this.Database, this.Parameters,
|
||||
))
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ func (this *Instance) Init() *Instance {
|
||||
option := &gorm.Config{
|
||||
DisableForeignKeyConstraintWhenMigrating: true,
|
||||
NamingStrategy: schema.NamingStrategy{
|
||||
TablePrefix: this.tablePrefix,
|
||||
SingularTable: this.singularTable,
|
||||
TablePrefix: this.tablePrefix,
|
||||
//SingularTable: this.singularTable,
|
||||
},
|
||||
}
|
||||
if this.debug {
|
||||
|
Reference in New Issue
Block a user