修改表唯一约束

This commit is contained in:
whyour
2022-01-27 00:49:44 +08:00
parent a3a62f65dd
commit 891619ad55
7 changed files with 23 additions and 15 deletions
+6 -2
View File
@@ -28,8 +28,12 @@ export default class EnvService {
}
public async insert(payloads: Env[]): Promise<Env[]> {
const docs = await EnvModel.bulkCreate(payloads);
return docs;
const result = [];
for (const env of payloads) {
const doc = await EnvModel.create(env, { returning: true });
result.push(doc);
}
return result;
}
public async update(payload: Env): Promise<Env> {