我从loopback收到这个警告 WARNING: relational database doesn't support {strict: false} mode. {strict: true} mode will be set for model Address instead.
这里是模型
import { Entity, model, property, belongsTo, hasMany} from '@loopback/repository';
import { Users } from './users.model';
import {Orders} from './orders.model';
@model({ settings: { strict: false } })
export class Address extends Entity {
@property({
type: 'number',
id: true,
generated: true,
})
address_id?: number;
@property({
type: 'string',
})
default?: string;
@belongsTo(() => Users)
user_id: number;
@hasMany(() => Orders, {keyTo: 'address_id'})
orders: Orders[];
// Define well-known properties here
// Indexer property to allow additional data
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[prop: string]: any;
constructor(data?: Partial<Address>) {
super(data);
}
}
export interface AddressRelations {
// describe navigational properties here
}
export type AddressWithRelations = Address & AddressRelations;
我从昨天才开始收到这个警告。这是什么意思?我是否需要将严格的设置改为真
这是一个警告,是为了警告说 strict: false
是被关系型数据库忽略的。从模型装饰器中删除该设置是安全的。
进一步阅读。