- Remove BMAD framework, IDE configs, dev screenshots, test files, internal docs, and backup files - Rename keep-notes/ to memento-note/ - Update all references from keep-notes to memento-note - Add Apache 2.0 license with Commons Clause (non-commercial restriction) - Add clean .gitignore and .env.docker.example
40 lines
1.5 KiB
JavaScript
40 lines
1.5 KiB
JavaScript
const { PrismaClient } = require('../memento-note/prisma/client-generated');
|
|
const prisma = new PrismaClient();
|
|
|
|
(async () => {
|
|
console.log('=== VERIFICATION DE LA MIGRATION ===\n');
|
|
|
|
// 1. Verifier les notebooks
|
|
const notebooks = await prisma.notebook.findMany({ include: { labels: true } });
|
|
console.log('Notebooks crees:', notebooks.length);
|
|
notebooks.forEach(nb => {
|
|
console.log(` - ${nb.name}: ${nb.labels?.length || 0} labels`);
|
|
});
|
|
|
|
// 2. Verifier les labels
|
|
const labels = await prisma.label.findMany({ where: { notebookId: { not: null } } });
|
|
console.log(`\nLabels avec notebookId: ${labels.length}`);
|
|
|
|
// 3. Verifier les notes
|
|
const notesInbox = await prisma.note.count({ where: { notebookId: null } });
|
|
const notesInNotebooks = await prisma.note.count({ where: { notebookId: { not: null } } });
|
|
console.log(`Notes dans Inbox: ${notesInbox}`);
|
|
console.log(`Notes dans des notebooks: ${notesInNotebooks}`);
|
|
|
|
// 4. Total
|
|
const totalNotes = await prisma.note.count();
|
|
const totalLabels = await prisma.label.count();
|
|
console.log(`\nTotaux:`);
|
|
console.log(` - Notes totales: ${totalNotes}`);
|
|
console.log(` - Labels totaux: ${totalLabels}`);
|
|
|
|
// 5. Sample labels with their notebook
|
|
console.log('\nSample labels:');
|
|
const sampleLabels = await prisma.label.findMany({ take: 3, include: { notebook: true } });
|
|
sampleLabels.forEach(l => {
|
|
console.log(` - ${l.name} -> ${l.notebook?.name || 'no notebook'}`);
|
|
});
|
|
|
|
await prisma.$disconnect();
|
|
})();
|