mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 15:27:27 +00:00
requested changes
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { Knex } from "knex";
|
import { Knex } from "knex";
|
||||||
|
|
||||||
import { TableName } from "../schemas";
|
import { TableName } from "../schemas";
|
||||||
import { createOnUpdateTrigger, dropOnUpdateTrigger } from "../utils";
|
|
||||||
|
|
||||||
export async function up(knex: Knex): Promise<void> {
|
export async function up(knex: Knex): Promise<void> {
|
||||||
const hasSecretReminderRecipientsTable = await knex.schema.hasTable(TableName.SecretReminderRecipients);
|
const hasSecretReminderRecipientsTable = await knex.schema.hasTable(TableName.SecretReminderRecipients);
|
||||||
@@ -23,8 +22,6 @@ export async function up(knex: Knex): Promise<void> {
|
|||||||
table.index("secretId");
|
table.index("secretId");
|
||||||
table.unique(["secretId", "userId"]);
|
table.unique(["secretId", "userId"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
await createOnUpdateTrigger(knex, TableName.SecretReminderRecipients);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,6 +30,5 @@ export async function down(knex: Knex): Promise<void> {
|
|||||||
|
|
||||||
if (hasSecretReminderRecipientsTable) {
|
if (hasSecretReminderRecipientsTable) {
|
||||||
await knex.schema.dropTableIfExists(TableName.SecretReminderRecipients);
|
await knex.schema.dropTableIfExists(TableName.SecretReminderRecipients);
|
||||||
await dropOnUpdateTrigger(knex, TableName.SecretReminderRecipients);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ export const secretQueueFactory = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipients) {
|
if (recipients?.length) {
|
||||||
await secretReminderRecipientsDAL.transaction(async (tx) => {
|
await secretReminderRecipientsDAL.transaction(async (tx) => {
|
||||||
await secretReminderRecipientsDAL.delete({ secretId: newSecret.id }, tx);
|
await secretReminderRecipientsDAL.delete({ secretId: newSecret.id }, tx);
|
||||||
await secretReminderRecipientsDAL.insertMany(
|
await secretReminderRecipientsDAL.insertMany(
|
||||||
|
|||||||
Reference in New Issue
Block a user