full upgrade to dev

This commit is contained in:
2026-01-07 14:30:00 +01:00
parent 4dc727fcd6
commit 26a8610aa7
34 changed files with 6890 additions and 920 deletions

73
prisma/migrations/quick-fix.sh Executable file
View File

@@ -0,0 +1,73 @@
#!/bin/bash
# Quick Fix Script for Portfolio Database
# This script creates the activity_status table needed for n8n integration
set -e
echo "🔧 Portfolio Database Quick Fix"
echo "================================"
echo ""
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if .env.local exists
if [ ! -f .env.local ]; then
echo -e "${RED}❌ Error: .env.local not found${NC}"
echo "Please create .env.local with DATABASE_URL"
exit 1
fi
# Load DATABASE_URL from .env.local
export $(grep -v '^#' .env.local | xargs)
if [ -z "$DATABASE_URL" ]; then
echo -e "${RED}❌ Error: DATABASE_URL not found in .env.local${NC}"
exit 1
fi
echo -e "${GREEN}✓ Found DATABASE_URL${NC}"
echo ""
# Extract database name from DATABASE_URL
DB_NAME=$(echo $DATABASE_URL | sed -n 's/.*\/\([^?]*\).*/\1/p')
echo "📦 Database: $DB_NAME"
echo ""
# Run the migration
echo "🚀 Creating activity_status table..."
echo ""
psql "$DATABASE_URL" -f prisma/migrations/create_activity_status.sql
if [ $? -eq 0 ]; then
echo ""
echo -e "${GREEN}✅ SUCCESS! Migration completed${NC}"
echo ""
echo "Verifying table..."
psql "$DATABASE_URL" -c "\d activity_status" | head -20
echo ""
echo "Checking default row..."
psql "$DATABASE_URL" -c "SELECT id, updated_at FROM activity_status LIMIT 1;"
echo ""
echo -e "${GREEN}🎉 All done! Your database is ready.${NC}"
echo ""
echo "Next steps:"
echo " 1. Restart your Next.js dev server: npm run dev"
echo " 2. Visit http://localhost:3000"
echo " 3. The activity feed should now work without errors"
else
echo ""
echo -e "${RED}❌ Migration failed${NC}"
echo ""
echo "Troubleshooting:"
echo " 1. Ensure PostgreSQL is running: pg_isready"
echo " 2. Check your DATABASE_URL in .env.local"
echo " 3. Verify database exists: psql -l | grep $DB_NAME"
echo " 4. Try manual migration: psql $DB_NAME -f prisma/migrations/create_activity_status.sql"
exit 1
fi