Midway v2.11.5 发布,orm 组件升级

栏目: 软件资讯 · 发布时间: 4年前

内容简介:Features 1、支持 orm 组件定义不同连接的 model 感谢社区用户 zkamisama 提供 PR。 新版本在使用 EntityModel 装饰器时,可以指定一个 connectionName,使得不同的实体可以归属到不同的连接中。 比如: @Entit...

Features

 

1、支持 orm 组件定义不同连接的 model

 

感谢社区用户 zkamisama 提供 PR。

 

新版本在使用 EntityModel 装饰器时,可以指定一个 connectionName,使得不同的实体可以归属到不同的连接中。

 

比如:

@EntityModel({
  connectionName: 'test',			// 可以将该 model 归属于 test 这个连接
})
export class OnlyTestLoadLog {
  @PrimaryGeneratedColumn({ name: 'id' })
  id: number;

  @Column({ name: 'content' })
  content: string;
}

 

同时,2.x 的 @midwayjs/orm 也切到 latest,主要变化有:

 

  • 1、package.json 中的 typeorm 变为 peer 依赖(应用可以自己安装,指定版本)
  • 2、Event Subscriber 中支持注入 ctx 和其他装饰器了
  • 3、就是上面的 PR 了:)

 

Bugfix

 

1、修复 egg 下特殊的目录查找错误的问题

 

用户反馈,如果目录为 src/src ,在启动时会读取到错误的目录导致启动失败。

 

新版本修复了查找的规则,处理了该问题。

 

2、处理阿里云 FC 本地开发时的 CORS 设置和服务器一致

 

该版本将本地开发模拟的网关和服务器保持一致。

 

 

其他

 

1、增加 decoratorManager 方法中丢失的 groupBy 参数

 

感谢社区用户 singlebyted 的 PR。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Coming of Age in Second Life

Coming of Age in Second Life

Tom Boellstorff / Princeton University Press / 2008-04-21 / USD 29.95

The gap between the virtual and the physical, and its effect on the ideas of personhood and relationships, is the most interesting aspect of Boellstorff's analysis... Boellstorff's portrayal of a virt......一起来看看 《Coming of Age in Second Life》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试