================================================================================ QUICK FIX FOR PRODUCTION ERROR ================================================================================ ERROR: "Unknown column 'p_id' in where clause" CAUSE: Database columns not renamed yet FIX: Run 4 simple commands ================================================================================ STEP 1: SSH TO PRODUCTION SERVER ================================================================================ ssh itplusus@95.216.111.103 [You'll be prompted for password: DmO4Jn3RMzRPitplus] ================================================================================ STEP 2: NAVIGATE TO API DIRECTORY ================================================================================ cd ~/public_html/api.it-plus.co [Should show: /home/itplusus/public_html/api.it-plus.co] ================================================================================ STEP 3: PULL LATEST CODE ================================================================================ git pull origin main [Wait for it to complete - should show new migration files] ================================================================================ STEP 4: RUN THE MIGRATIONS (THIS FIXES THE ERROR) ================================================================================ php artisan migrate [EXPECTED OUTPUT: INFO Running migrations. 2025_12_08_131000_update_likes_table_schema_to_match_production . DONE 2025_12_08_131039_update_guest_likes_table_to_match_production .. DONE ] [If you see DONE, the fix is complete!] ================================================================================ STEP 5: CLEAR CACHES (IMPORTANT) ================================================================================ php artisan cache:clear && php artisan config:clear [You should see: "Application cache cleared successfully"] ================================================================================ STEP 6: VERIFY SUCCESS ================================================================================ tail -20 storage/logs/laravel.log | grep -i "column not found" [If you see NOTHING, the error is fixed!] [If you see errors, run: php artisan migrate:status] ================================================================================ DONE! ================================================================================ Test the fix: curl "https://api.it-plus.co/api/blogs?per_page=3" \ -H "Authorization: Bearer YOUR_TOKEN" [Should return blog data with no "column not found" errors] ================================================================================ IF SOMETHING GOES WRONG ================================================================================ Rollback the migrations: cd ~/public_html/api.it-plus.co php artisan migrate:rollback --step=2 Then check logs: tail -50 storage/logs/laravel.log ================================================================================ THAT'S IT! ================================================================================ The migration renames these columns: - likes table: item_id → p_id, removes item_type - guest_likes table: item_id → p_id That's why the error will go away!