31 lines
823 B
JavaScript
31 lines
823 B
JavaScript
const { PrismaClient } = require('@prisma/client');
|
|
const prisma = new PrismaClient();
|
|
|
|
async function checkNotesTable() {
|
|
try {
|
|
const result = await prisma.$queryRaw`
|
|
SELECT column_name, data_type, is_nullable
|
|
FROM information_schema.columns
|
|
WHERE table_name = 'notes'
|
|
ORDER BY ordinal_position
|
|
`;
|
|
console.log('Notes table columns:');
|
|
console.log(JSON.stringify(result, null, 2));
|
|
|
|
// Check if table exists
|
|
const tableExists = await prisma.$queryRaw`
|
|
SELECT EXISTS (
|
|
SELECT FROM information_schema.tables
|
|
WHERE table_name = 'notes'
|
|
)
|
|
`;
|
|
console.log('\nTable exists:', tableExists[0].exists);
|
|
} catch (error) {
|
|
console.error('Error:', error.message);
|
|
} finally {
|
|
await prisma.$disconnect();
|
|
}
|
|
}
|
|
|
|
checkNotesTable();
|