Enviar arquivos para "/"

This commit is contained in:
2026-07-20 17:04:46 +00:00
parent 3c318d399a
commit b3f9ee96f8
3 changed files with 98 additions and 0 deletions

34
seed.ts Normal file
View File

@@ -0,0 +1,34 @@
import { PrismaClient } from '@prisma/client';
import bcrypt from 'bcrypt';
const prisma = new PrismaClient();
async function main() {
console.log('Iniciando o seed...');
const passwordHash = await bcrypt.hash('123456', 10);
const admin = await prisma.usuario.upsert({
where: { email: 'admin@gastrobar.com' },
update: {},
create: {
nome: 'Administrador',
email: 'admin@gastrobar.com',
senha: passwordHash,
role: 'ADMIN',
ativo: true,
},
});
console.log('Usuário admin criado:', admin.email);
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});