#!/bin/bash
set -e

echo "Generating Prisma client for deployment..."

npx prisma generate

if [ ! -f "lib/generated/prisma/index.js" ]; then
    echo "Error: lib/generated/prisma/index.js was not created."
    exit 1
fi

echo ""
echo "Prisma client generated successfully."
echo ""
echo "Commit these files before deploying:"
echo "git add lib/generated/prisma"
echo "git commit -m 'Add generated Prisma client'"
echo "git push"
