Initial commit - Prode Mundial 2026
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo ">>> Ejecutando migraciones..."
|
||||
npx prisma migrate deploy
|
||||
|
||||
echo ">>> Verificando seed..."
|
||||
TEAM_COUNT=$(node -e "
|
||||
const { PrismaClient } = require('./node_modules/@prisma/client');
|
||||
const p = new PrismaClient();
|
||||
p.team.count().then(c => { console.log(c); p.\$disconnect(); }).catch(() => { console.log(0); });
|
||||
")
|
||||
|
||||
if [ "$TEAM_COUNT" = "0" ]; then
|
||||
echo ">>> Cargando datos iniciales..."
|
||||
node -e "
|
||||
const { execSync } = require('child_process');
|
||||
execSync('node prisma/seed.js', { stdio: 'inherit' });
|
||||
" || echo "Seed via JS no disponible, salteando..."
|
||||
fi
|
||||
|
||||
echo ">>> Iniciando servidor..."
|
||||
exec node server.js
|
||||
Reference in New Issue
Block a user