Massive bug fix. Clear button added into fields.
This commit is contained in:
@@ -7,10 +7,15 @@ const prisma = new PrismaClient();
|
||||
async function backup() {
|
||||
try {
|
||||
console.log('Starting backup...');
|
||||
const sporadicSets = await prisma.sporadicSet.findMany();
|
||||
// Backup Quick Log sessions and their sets (formerly SporadicSets)
|
||||
const quickLogSessions = await prisma.workoutSession.findMany({
|
||||
where: { type: 'QUICK_LOG' },
|
||||
include: { sets: true }
|
||||
});
|
||||
|
||||
const backupPath = path.join(__dirname, '../../sporadic_backup.json');
|
||||
fs.writeFileSync(backupPath, JSON.stringify(sporadicSets, null, 2));
|
||||
console.log(`Backed up ${sporadicSets.length} sporadic sets to ${backupPath}`);
|
||||
fs.writeFileSync(backupPath, JSON.stringify(quickLogSessions, null, 2));
|
||||
console.log(`Backed up ${quickLogSessions.length} quick log sessions to ${backupPath}`);
|
||||
} catch (error) {
|
||||
console.error('Backup failed:', error);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user