1、model名与表名相同,在Explorer上使用出现以下错误

2、解决办法
//1、models/model.config.ts
export class ModelConfig {
strict: boolean;
forceId: boolean;
mysql: {schema: string, table: string};
validateUpsert: boolean;
idInjection: boolean;
constructor(data: string) {
this.mysql = {schema: 'gaspar', table: data}
this.strict = true;
this.forceId = false;
this.validateUpsert = true;
this.idInjection = true;
}
}
// 2、对应的model文件里引用
import { ModelConfig } from './model.config';
@model({settings: new ModelConfig('jobs')})
...
4036

被折叠的 条评论
为什么被折叠?



