first commit
This commit is contained in:
commit
c9fb67e751
423 files changed
+53287
No files matched your search
@@ -0,0 +1,34 @@
|
||||
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();
|
||||
});
|
||||
Reference in new issue
Block a user