Skip to content

Latest commit

 

History

History
75 lines (49 loc) · 2.02 KB

File metadata and controls

75 lines (49 loc) · 2.02 KB

🚨 Quick Fix for "column last_seen does not exist" Error

🔍 Problem

The error "column "last_seen" does not exist" means your users table is missing required columns. This happens when the database schema wasn't applied completely.

Solution Options

Option 1: Quick Fix (Recommended)

  1. Go to your Supabase Dashboard
  2. Click "SQL Editor"
  3. Copy and paste the contents of database/fix_users_table.sql
  4. Click "Run"

This will add the missing columns to your existing users table.

Option 2: Complete Reset (If Option 1 doesn't work)

  1. Go to your Supabase Dashboard
  2. Click "SQL Editor"
  3. Copy and paste the contents of database/complete_schema_fix.sql
  4. Click "Run"

This will recreate all tables with the correct structure.

🧪 Test the Fix

After applying either fix:

  1. Restart your dev server:

    cd frontend
    npm run dev
  2. Test registration:

📋 What the Fix Does

Quick Fix (fix_users_table.sql):

  • Adds missing columns to existing users table
  • Preserves any existing data
  • Safe to run multiple times

Complete Fix (complete_schema_fix.sql):

  • Recreates all tables with correct structure
  • Includes all indexes, triggers, and policies
  • Ensures everything is properly set up

Success Criteria

The fix is working when:

  • ✅ No more "column does not exist" errors
  • ✅ User registration works without errors
  • ✅ Users appear in the users table in Supabase
  • ✅ All required columns are present

🚨 If You Still Get Errors

  1. Check the SQL Editor for any error messages
  2. Make sure you copied the entire file content
  3. Try the complete reset option if the quick fix doesn't work
  4. Check your Supabase project permissions

The quick fix should resolve the "last_seen" column error immediately! 🚀