#!/bin/bash

# Change to the API directory
cd packages/api

# Run Prisma migration to update the Earning model
npx prisma db execute --file=./prisma/migrations/20240904_add_commission_details_to_earning.sql --schema=./prisma/schema.prisma

echo "✅ Commission fields added to the Earning model"

# Generate updated Prisma client
npx prisma generate

echo "✅ Prisma client updated"
