mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Ready for 1.1.2-rc.1
This commit is contained in:
@@ -19,23 +19,14 @@ export async function enforceRetentionCount(databaseId: string, count: number) {
|
||||
const toDelete = backups.slice(count); // keep first `count`, delete rest
|
||||
|
||||
for (const b of toDelete) {
|
||||
// await db.delete(drizzleDb.schemas.backup).where(eq(drizzleDb.schemas.backup.id, b.id));
|
||||
|
||||
const deletion = await deleteBackupCronAction({
|
||||
await deleteBackupCronAction({
|
||||
backupId: b.id,
|
||||
databaseId: b.databaseId,
|
||||
file: b.file!,
|
||||
projectSlug: b.database.project?.slug!
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
if (deletion.data.success) {
|
||||
// @ts-ignore
|
||||
console.log(deletion.data.actionSuccess.message);
|
||||
} else {
|
||||
// @ts-ignore
|
||||
console.log(deletion.data.actionError.message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -21,25 +21,14 @@ export async function enforceRetentionDays(databaseId: string, days: number) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
for (const backup of expiredBackups) {
|
||||
|
||||
const deletion = await deleteBackupCronAction({
|
||||
await deleteBackupCronAction({
|
||||
backupId: backup.id,
|
||||
databaseId: backup.databaseId,
|
||||
file: backup.file!,
|
||||
projectSlug: backup.database.project?.slug!
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
if (deletion.data.success) {
|
||||
// @ts-ignore
|
||||
console.log(deletion.data.actionSuccess.message);
|
||||
} else {
|
||||
// @ts-ignore
|
||||
console.log(deletion.data.actionError.message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,26 +60,13 @@ export async function enforceRetentionGFS(databaseId: string, gfsSettings: {
|
||||
// Delete backups not in `toKeep`
|
||||
for (const b of backups) {
|
||||
if (!toKeep.has(b.id)) {
|
||||
// await db.delete(drizzleDb.schemas.backup).where(eq(drizzleDb.schemas.backup.id, b.id));
|
||||
|
||||
|
||||
const deletion = await deleteBackupCronAction({
|
||||
await deleteBackupCronAction({
|
||||
backupId: b.id,
|
||||
databaseId: b.databaseId,
|
||||
file: b.file!,
|
||||
projectSlug: b.database.project?.slug!
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
if (deletion.data.success) {
|
||||
// @ts-ignore
|
||||
console.log(deletion.data.actionSuccess.message);
|
||||
} else {
|
||||
// @ts-ignore
|
||||
console.log(deletion.data.actionError.message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,11 +64,6 @@ export const deleteBackupCronAction = action
|
||||
};
|
||||
}
|
||||
|
||||
// await db
|
||||
// .delete(drizzleDb.schemas.backup)
|
||||
// .where(and(eq(drizzleDb.schemas.backup.id, parsedInput.backupId), eq(drizzleDb.schemas.backup.databaseId, parsedInput.databaseId)))
|
||||
// .execute();
|
||||
|
||||
return {
|
||||
success: true,
|
||||
actionSuccess: {
|
||||
|
||||
Reference in New Issue
Block a user