File size: 594 Bytes
3bf9adc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import { PrismaClient } from '@prisma/client';
async function main() {
const prisma = new PrismaClient();
try {
console.log('Inserting default organization via raw SQL...');
await prisma.$executeRaw`INSERT INTO "Organization" (id, name, "createdAt", "updatedAt") VALUES ('default-org-id', 'XAMLÉ Global', NOW(), NOW()) ON CONFLICT (id) DO NOTHING;`;
console.log('Success!');
} catch (e) {
console.error('Failed to insert via raw SQL. It might be because the table does not exist yet.');
console.error(e);
} finally {
await prisma.$disconnect();
}
}
main();
|