Files
usda-vision/docs/SUPABASE_MIGRATION.md
salirezav 38a7846e7b Update .gitignore and refactor docker-compose.sh for improved host IP detection
- Added .host-ip to .gitignore to prevent tracking of host IP configurations.
- Enhanced docker-compose.sh to prioritize HOST_IP environment variable, fallback to .host-ip file, and finally auto-detect the host IP, improving robustness in various environments.
- Updated documentation to reflect changes in Supabase migration paths and removed references to deprecated management-dashboard-web-app directory.
2026-02-09 13:21:08 -05:00

2.5 KiB

Supabase Directory Migration

What Changed

The Supabase configuration has been moved from management-dashboard-web-app/supabase/ to the project root supabase/ directory.

Why This Change?

  1. Better Architecture: Supabase is shared infrastructure, not specific to the web app
  2. Monorepo Best Practice: Infrastructure concerns should be at the root level
  3. Easier Access: Other services (APIs, scripts) can now easily reference the database
  4. Clearer Ownership: Makes it obvious that Supabase is a project-wide resource

Migration Steps

For Docker Compose Users

No action needed! The docker-compose.yml has been updated to use the new paths. Just restart your containers:

docker compose down
docker compose up -d

For Supabase CLI Users

Before (old way):

cd management-dashboard-web-app
supabase start
supabase db reset

After (new way):

# From project root - no need to cd!
supabase start
supabase db reset

The Supabase CLI automatically looks for the supabase/ directory in the current working directory, so you can now run all Supabase commands from the project root.

Updating Your Workflow

If you have scripts or documentation that reference the old path, update them:

  • management-dashboard-web-app/supabase/migrations/

  • supabase/migrations/

  • management-dashboard-web-app/supabase/config.toml

  • supabase/config.toml

Current State

The old directory (management-dashboard-web-app/supabase/) has been removed. All Supabase and DB configuration, migrations, and seeds now live only under the project root supabase/ directory. Docker Compose and the Supabase CLI use root supabase/ exclusively.

Verification

To verify the migration:

  1. Check docker-compose paths (only root supabase should be referenced):

    grep "supabase" docker-compose.yml
    # Should show only ./supabase/ (no management-dashboard-web-app/supabase/)
    
  2. Test Supabase CLI:

    # From project root
    supabase status
    # Should work without needing to cd into management-dashboard-web-app
    
  3. Test migrations:

    docker compose up -d
    docker compose logs supabase-migrate
    # Should show migrations running successfully
    

Benefits

Run Supabase commands from project root
Clearer project structure
Easier to share database across services
Better alignment with monorepo best practices
Infrastructure separated from application code