Skip to content

Commit

Permalink
Update v1.12.9
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbrzzl committed Jun 18, 2023
1 parent d730ff3 commit d687ce8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions upgrade/v1.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Update dependencies in the `go.mod` file:
go get -u github.com/goravel/framework@v1.12.0 && go mod tidy
```

There is an error after running `go mod tidy`, the error will be solved after performing the following upgrade steps.

### 2. Modify `bootstrap/app.go`

```go
Expand Down Expand Up @@ -181,14 +183,18 @@ If you are using the `redis` driver, please refer to the `redis` driver document
| ----------- | -------------- |
| Redis | https://github.com/goravel/redis |
### 9. Change The Type Of CreatedAt, UpdatedAt In Model
### 9. Change The Type Of CreatedAt, UpdatedAt In Model(If using)
In order to make the time type more standard in API output, the type of `CreatedAt`, `UpdatedAt` in `Model` change to `carbon.DateTime` from `time.Time`. If you have additional processing for these two fields, you can get the original `time.Time` type through the `CreatedAt.ToStdTime()` method.
### 10. Optimize The Rule Of Validation Module
### 10. Optimize The Rule Of Validation Module(If using)
Check the zero value in the original validate rule, for example, if the rule is set to `date` and `required` is not set, and the field is empty or not passed, the validation module will prompt that field is required. After optimization, the validation module will passed the check, which is more intuitive to use. If you are using relevant validation, please ensure that the upgrade is as expected.
### 11. Install dependencies again
Run `go mod tidy`
## Function Introduction
### Service Container
Expand Down
6 changes: 6 additions & 0 deletions zh/upgrade/v1.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
go get -u github.com/goravel/framework@v1.12.0 && go mod tidy
```

`go mod tidy` 将会抛出一个错误,执行完下面升级步骤即可解决。

### 2. 修改 `bootstrap/app.go`

```go
Expand Down Expand Up @@ -189,6 +191,10 @@ func (receiver *VendorPublishCommand) Extend() command.Extend {
原有校验规则中对零值进行校验,例如设置规则为 `date` 且没有设置 `required`,如果该字段为空或未传入,会提示该字段必填。优化后,将跳过校验,更符合使用直觉。如果您用到了相关校验,请确保升级后与预期一致。
### 11. 再次安装依赖
运行 `go mod tidy` 命令。
## 功能介绍
### 服务容器
Expand Down

0 comments on commit d687ce8

Please sign in to comment.