feat:完善项目信息

This commit is contained in:
henry
2021-12-28 10:38:02 +08:00
parent 76ca837fd6
commit 7eb8e5c48b
13 changed files with 161 additions and 137 deletions

View File

@ -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,
))
}

View File

@ -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 {