fix: 新增一处外键检查的assert错误信息
This commit is contained in:
parent
aade97762f
commit
66cf652646
|
|
@ -209,7 +209,7 @@ class MysqlStore extends CascadeStore_1.CascadeStore {
|
|||
// 边界,如果是toModi的对象,这里的外键确实有可能为空
|
||||
// assert(schema[e].toModi || r[`${attr}Id`] === r[attr].id, `对象${<string>e}取数据时,发现其外键与连接的对象的主键不一致,rowId是${r.id},其${attr}Id值为${r[`${attr}Id`]},连接的对象的主键为${r[attr].id}`);
|
||||
if (r[attr].id === null) {
|
||||
(0, assert_1.default)(schema[e].toModi || r[`${attr}Id`] === null);
|
||||
(0, assert_1.default)(schema[e].toModi || r[`${attr}Id`] === null, `对象${String(e)}取数据时,发现其外键找不到目标对象,rowId是${r.id},其外键${attr}Id值为${r[`${attr}Id`]}`);
|
||||
delete r[attr];
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ export class MysqlStore<ED extends EntityDict & BaseEntityDict, Cxt extends Asyn
|
|||
// 边界,如果是toModi的对象,这里的外键确实有可能为空
|
||||
// assert(schema[e].toModi || r[`${attr}Id`] === r[attr].id, `对象${<string>e}取数据时,发现其外键与连接的对象的主键不一致,rowId是${r.id},其${attr}Id值为${r[`${attr}Id`]},连接的对象的主键为${r[attr].id}`);
|
||||
if (r[attr].id === null) {
|
||||
assert(schema[e].toModi || r[`${attr}Id`] === null);
|
||||
assert(schema[e].toModi || r[`${attr}Id`] === null, `对象${String(e)}取数据时,发现其外键找不到目标对象,rowId是${r.id},其外键${attr}Id值为${r[`${attr}Id`]}`);
|
||||
delete r[attr];
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue