Upgrading To v1.9 From v1.8
Enhancements 🚀
- Add database read-write separation(1.9.0)
- Add database pool configuration(1.9.0)
- Custom .env path(1.9.0)
- Cache add memory driver(1.9.0)
- Orm add Paginate method(1.9.0)
- Add make command(1.9.0)
- Add new methods for Response(1.9.0)
Breaking Changes 🛠
Bug Fixes 🐛
- File gets the wrong file type(1.9.0)
- Fix template error on make:event and make:listener command(1.9.0)
- Fix some types cannot obtain suffixes when save file(1.9.1)
Dependency Updates ⬆️
- build(deps): bump github.com/gin-gonic/gin from v1.7.3 to v1.8.2
Upgrade Guide
Estimated Upgrade Time: 10 Minutes
Updating Dependencies
Update dependencies in the go.mod
file:
go get -u github.com/goravel/framework@v1.9.0
Add database read-write separation
Version: v1.9.0
Database supports read-write separation,For Detail.
Add database pool configuration
Version: v1.9.0
Add pool configuration for the database configuration file: config/database.go
, For Detail.
Custom .env path
Version: v1.9.0
// Develop
go run . --env=../.env
// Compiled
./main --env=../.env
Cache add memory driver
Version: v1.9.0
config/cache.go
add memory
configuration:
"stores": map[string]any{
// New
"memory": map[string]any{
"driver": "memory",
},
},
Orm add Paginate method
Version: v1.9.0
facades.Orm
add Paginate
method, For detail.
Add make command
Version: v1.9.0
// Create controller
go run . artisan make:controller UserController
// Create middleware
go run . artisan make:middleware Cors
// Create model
go run . artisan make:model User
Add new methods for Response
Version: v1.9.0
Method | Action |
---|---|
Data | Custom return |
Redirect | Redirect |
Add return for Request PrepareForValidation method
Version: v1.9.0
If you are using PrepareForValidation method in Validation, please add a return value: PrepareForValidation(data validation.Data) error
.
File gets the wrong file type
Version: v1.9.0
Fix the problem that .docx
, .xlsx
, etc. are incorrectly identified as .zip
.
Fix template error on make:event and make:listener command
Version: v1.9.0
import "github.com/goravel/framework/contracts/events"
改为 import "github.com/goravel/framework/contracts/event"
Fix some types cannot obtain suffixes when save file
Version: v1.9.1
Some types cannot obtain suffixes through the code shown below:
file, err := ctx.Request().File()
file.Store("upload")