---
deployment:
  tasks:
    # 1. Run PHP migration script to update the database
    - export DEPLOYPATH=/home/YOUR_CPANEL_USER/public_html/gopools
    - php $DEPLOYPATH/scripts/migrate.php

    # 2. Set correct permissions for uploads directory
    - mkdir -p $DEPLOYPATH/public/uploads/project_photos
    - mkdir -p $DEPLOYPATH/public/uploads/project_offers
    - mkdir -p $DEPLOYPATH/public/uploads/avatars
    - chmod -R 755 $DEPLOYPATH/public/uploads

    # 3. Clear PHP opcode cache (if available)
    - php -r "if(function_exists('opcache_reset')) opcache_reset();" 2>/dev/null || true
