Upgrading To v1.8 From v1.7
Last updated
Last updated
[[toc]]
Estimated Upgrade Time: 1 Minutes
Update dependencies in the go.mod
file:
Version: v1.8.0
Add methods for Orm, to handle model association:
Association
DB
Load
LoadMissing
Omit
With
Version: v1.8.0
Add methods for ctx.Request()
, to enrich the format of Query
parameters:
QueryArray
QueryMap
Version: v1.8.0
Add Origin
method to ctx.Response()
, you can get all information of Response
in the HTTP middleware.
Version: v1.8.0
The import order in the bootstrap/app.go
file change to:
Version: v1.8.0
Run the command that generate the migrate file: go run . artisan make:migration create_users_table
, the corresponding migration file will be generated based on the default database driver currently in use(facades.Config.GetString("database.default")
).
Version: v1.8.0
If you use mock.Validator
to write unit tests, the following modifications are required:
Version: v1.8.0
If you use framework constants such as support.Mysql
to judge the database driver, you need to make the following modifications:
The new constants such as orm.Mysql
are of type orm.Driver
and can be converted to a string type using the orm.Mysql.String()
method.
Version: v1.8.0
The database.NewGormInstance
method will be deprecated in v1.9.0 version, it can be used in current version, if you use the method to get the gorm
instance, the following modifications are required:
Version: v1.8.1
When high concurrent access, reading facades.Orm
for the first time may return nil.
Version: v1.8.2
You can send mail by 25, 465, 587 ports now.
Version: v1.8.3
facades.Route
Add RunTLS
method,support start HTTPS server, .