|
|
@ -2206,22 +2206,25 @@ class BaseModelSqlv2 { |
|
|
|
transaction = await this.dbDriver.transaction(); |
|
|
|
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) { |
|
|
|
await this.validate(d); |
|
|
|
|
|
|
|
const pkValues = await this._extractPksValues(d); |
|
|
|
const pkValues = await this._extractPksValues(d); |
|
|
|
if (!pkValues) { |
|
|
|
if (!pkValues) { |
|
|
|
// 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); |
|
|
|
await transaction(this.tnPath).del().where(d); |
|
|
|
res.push(d); |
|
|
|
res.push(d); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await transaction.commit(); |
|
|
|
await transaction.commit(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const pkValues of deletePkValues) { |
|
|
|
|
|
|
|
deleted.push(await this.readByPk(pkValues)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await this.afterBulkDelete(deleted, this.dbDriver, cookie); |
|
|
|
await this.afterBulkDelete(deleted, this.dbDriver, cookie); |
|
|
|
|
|
|
|
|
|
|
|
return res; |
|
|
|
return res; |
|
|
|