Skip to content

Commit

Permalink
v2.0.8
Browse files Browse the repository at this point in the history
1、修改sqplite的支持
2、修正已知问题
  • Loading branch information
wenjianzhang authored Jan 22, 2022
2 parents 34b3395 + e9f36e7 commit e2c5075
Show file tree
Hide file tree
Showing 7 changed files with 335 additions and 330 deletions.
6 changes: 3 additions & 3 deletions README.Zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
``` bash
# 首次配置需要初始化数据库资源信息
# macOS or linux 下使用
$ ./go-admin migrate -c=config/settings.dev.yml
$ ./go-admin migrate -c config/settings.dev.yml

# ⚠️注意:windows 下使用
$ go-admin.exe migrate -c=config/settings.dev.yml
$ go-admin.exe migrate -c config/settings.dev.yml


# 启动项目,也可以用IDE进行调试
Expand Down Expand Up @@ -284,4 +284,4 @@ npm run dev

[MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md)

Copyright (c) 2020 wenjianzhang
Copyright (c) 2020 wenjianzhang
12 changes: 10 additions & 2 deletions cmd/migrate/migration/models/initdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ import (

func InitDb(db *gorm.DB) (err error) {
filePath := "config/db.sql"
err = ExecSql(db, filePath)
if global.Driver == "postgres" {
filePath = "config/pg.sql"
err = ExecSql(db, filePath)
} else if global.Driver == "mysql" {
filePath = "config/db-begin-mysql.sql"
err = ExecSql(db, filePath)
filePath = "config/db.sql"
err = ExecSql(db, filePath)
filePath = "config/db-end-mysql.sql"
err = ExecSql(db, filePath)
} else {
err = ExecSql(db, filePath)
}
return err
}
Expand Down Expand Up @@ -52,4 +60,4 @@ func Ioutil(filePath string) (string, error) {
} else {
return "", err
}
}
}
4 changes: 2 additions & 2 deletions common/global/adm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package global

const (
// Version go-admin version info
Version = "2.0.6"
Version = "2.0.8"
)

var (
Source string
Driver string
DBName string
)
)
2 changes: 2 additions & 0 deletions config/db-begin-mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
1 change: 1 addition & 0 deletions config/db-end-mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SET FOREIGN_KEY_CHECKS = 1;
640 changes: 317 additions & 323 deletions config/db.sql

Large diffs are not rendered by default.

Binary file added go-admin-db.db
Binary file not shown.

0 comments on commit e2c5075

Please sign in to comment.