|
|
@ -3198,6 +3198,13 @@ class BaseModelSqlv2 { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (raw) await this.model.getColumns(); |
|
|
|
if (raw) await this.model.getColumns(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// validate update data
|
|
|
|
|
|
|
|
if (!raw) { |
|
|
|
|
|
|
|
for (const d of datas) { |
|
|
|
|
|
|
|
await this.validate(d); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const updateDatas = raw |
|
|
|
const updateDatas = raw |
|
|
|
? datas |
|
|
|
? datas |
|
|
|
: await Promise.all( |
|
|
|
: await Promise.all( |
|
|
@ -3211,7 +3218,6 @@ class BaseModelSqlv2 { |
|
|
|
const updatePkValues = []; |
|
|
|
const updatePkValues = []; |
|
|
|
const toBeUpdated = []; |
|
|
|
const toBeUpdated = []; |
|
|
|
for (const d of updateDatas) { |
|
|
|
for (const d of updateDatas) { |
|
|
|
if (!raw) await this.validate(d); |
|
|
|
|
|
|
|
const pkValues = await this._extractPksValues(d); |
|
|
|
const pkValues = await this._extractPksValues(d); |
|
|
|
if (!pkValues) { |
|
|
|
if (!pkValues) { |
|
|
|
// throw or skip if no pk provided
|
|
|
|
// throw or skip if no pk provided
|
|
|
|