|
|
@ -2203,10 +2203,7 @@ class BaseModelSqlv2 { |
|
|
|
ids.map((d) => this.model.mapAliasToColumn(d)) |
|
|
|
ids.map((d) => this.model.mapAliasToColumn(d)) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
transaction = await this.dbDriver.transaction(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const deleted = []; |
|
|
|
const deleted = []; |
|
|
|
const deletePkValues = []; |
|
|
|
|
|
|
|
const res = []; |
|
|
|
const res = []; |
|
|
|
for (const d of deleteIds) { |
|
|
|
for (const d of deleteIds) { |
|
|
|
const pkValues = await this._extractPksValues(d); |
|
|
|
const pkValues = await this._extractPksValues(d); |
|
|
@ -2214,13 +2211,14 @@ class BaseModelSqlv2 { |
|
|
|
// pk not specified - bypass
|
|
|
|
// pk not specified - bypass
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
deletePkValues.push(pkValues); |
|
|
|
deleted.push(await this.readByPk(pkValues)); |
|
|
|
await transaction(this.tnPath).del().where(d); |
|
|
|
|
|
|
|
res.push(d); |
|
|
|
res.push(d); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (const pkValues of deletePkValues) { |
|
|
|
transaction = await this.dbDriver.transaction(); |
|
|
|
deleted.push(await this.readByPk(pkValues)); |
|
|
|
|
|
|
|
|
|
|
|
for (const d of res) { |
|
|
|
|
|
|
|
await transaction(this.tnPath).del().where(d); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await transaction.commit(); |
|
|
|
await transaction.commit(); |
|
|
|