|
|
@ -3210,7 +3210,12 @@ class BaseModelSqlv2 { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async bulkUpdateAll( |
|
|
|
async bulkUpdateAll( |
|
|
|
args: { where?: string; filterArr?: Filter[]; viewId?: string } = {}, |
|
|
|
args: { |
|
|
|
|
|
|
|
where?: string; |
|
|
|
|
|
|
|
filterArr?: Filter[]; |
|
|
|
|
|
|
|
viewId?: string; |
|
|
|
|
|
|
|
skipValidationAndHooks?: boolean; |
|
|
|
|
|
|
|
} = {}, |
|
|
|
data, |
|
|
|
data, |
|
|
|
{ cookie }: { cookie?: any } = {}, |
|
|
|
{ cookie }: { cookie?: any } = {}, |
|
|
|
) { |
|
|
|
) { |
|
|
@ -3221,7 +3226,7 @@ class BaseModelSqlv2 { |
|
|
|
this.clientMeta, |
|
|
|
this.clientMeta, |
|
|
|
this.dbDriver, |
|
|
|
this.dbDriver, |
|
|
|
); |
|
|
|
); |
|
|
|
await this.validate(updateData); |
|
|
|
if (!args.skipValidationAndHooks) await this.validate(updateData); |
|
|
|
const pkValues = await this._extractPksValues(updateData); |
|
|
|
const pkValues = await this._extractPksValues(updateData); |
|
|
|
if (pkValues) { |
|
|
|
if (pkValues) { |
|
|
|
// pk is specified - by pass
|
|
|
|
// pk is specified - by pass
|
|
|
@ -3255,7 +3260,7 @@ class BaseModelSqlv2 { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await conditionV2(this, conditionObj, qb); |
|
|
|
await conditionV2(this, conditionObj, qb, undefined, true); |
|
|
|
|
|
|
|
|
|
|
|
count = ( |
|
|
|
count = ( |
|
|
|
await this.execAndParse( |
|
|
|
await this.execAndParse( |
|
|
@ -3273,7 +3278,8 @@ class BaseModelSqlv2 { |
|
|
|
await this.execAndParse(qb, null, { raw: true }); |
|
|
|
await this.execAndParse(qb, null, { raw: true }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await this.afterBulkUpdate(null, count, this.dbDriver, cookie, true); |
|
|
|
if (!args.skipValidationAndHooks) |
|
|
|
|
|
|
|
await this.afterBulkUpdate(null, count, this.dbDriver, cookie, true); |
|
|
|
|
|
|
|
|
|
|
|
return count; |
|
|
|
return count; |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|