|
|
@ -2193,7 +2193,21 @@ class BaseModelSqlv2 { |
|
|
|
await this.beforeInsert(insertObj, trx, cookie); |
|
|
|
await this.beforeInsert(insertObj, trx, cookie); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await this.model.getColumns(); |
|
|
|
const columns = await this.model.getColumns(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//remove auto increment columns if present in body
|
|
|
|
|
|
|
|
for (const col of columns) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (col.ai == true) { |
|
|
|
|
|
|
|
const keyName = data?.[col.column_name] !== undefined |
|
|
|
|
|
|
|
? col.column_name |
|
|
|
|
|
|
|
: col.title |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (data[keyName]) { |
|
|
|
|
|
|
|
delete data[keyName] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await this.prepareAttachmentData(insertObj); |
|
|
|
await this.prepareAttachmentData(insertObj); |
|
|
|
|
|
|
|
|
|
|
|