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
|
const toDelete = backups.slice(count); // keep first `count`, delete rest
|
||||||
|
|
||||||
for (const b of toDelete) {
|
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,
|
backupId: b.id,
|
||||||
databaseId: b.databaseId,
|
databaseId: b.databaseId,
|
||||||
file: b.file!,
|
file: b.file!,
|
||||||
projectSlug: b.database.project?.slug!
|
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) {
|
for (const backup of expiredBackups) {
|
||||||
|
await deleteBackupCronAction({
|
||||||
const deletion = await deleteBackupCronAction({
|
|
||||||
backupId: backup.id,
|
backupId: backup.id,
|
||||||
databaseId: backup.databaseId,
|
databaseId: backup.databaseId,
|
||||||
file: backup.file!,
|
file: backup.file!,
|
||||||
projectSlug: backup.database.project?.slug!
|
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`
|
// Delete backups not in `toKeep`
|
||||||
for (const b of backups) {
|
for (const b of backups) {
|
||||||
if (!toKeep.has(b.id)) {
|
if (!toKeep.has(b.id)) {
|
||||||
// await db.delete(drizzleDb.schemas.backup).where(eq(drizzleDb.schemas.backup.id, b.id));
|
|
||||||
|
|
||||||
|
await deleteBackupCronAction({
|
||||||
const deletion = await deleteBackupCronAction({
|
|
||||||
backupId: b.id,
|
backupId: b.id,
|
||||||
databaseId: b.databaseId,
|
databaseId: b.databaseId,
|
||||||
file: b.file!,
|
file: b.file!,
|
||||||
projectSlug: b.database.project?.slug!
|
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 {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
actionSuccess: {
|
actionSuccess: {
|
||||||
|
|||||||
Reference in New Issue
Block a user