import { PrismaClient } from "@prisma/client"; const prisma = new PrismaClient(); async function main() { await prisma.$executeRaw` CREATE TABLE IF NOT EXISTS "configuracao_documento" ( "id" UUID NOT NULL DEFAULT gen_random_uuid(), "headerImageUrl" TEXT, "footerImageUrl" TEXT, "logoUrl" TEXT, "criadoEm" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT "configuracao_documento_pkey" PRIMARY KEY ("id") ); `; // Inserir configuração padrão await prisma.configuracaoDocumento.create({ data: { headerImageUrl: "", footerImageUrl: "", logoUrl: "", }, }); } main() .catch((e) => { console.error(e); process.exit(1); }) .finally(async () => { await prisma.$disconnect(); });