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