# Both Contexts Deployment

When `RUN_BOTH=true` (auto-detected for client projects with SmartStack NuGet):

```bash
# 1. Deploy CoreDbContext first (system tables: Users, Roles, Tenants...)
echo "=== Deploying CoreDbContext (core schema) ==="
DBCONTEXT="CoreDbContext"
SCHEMA="core"
# Run steps 2-6 with CoreDbContext...

dotnet ef database update \
  --context "CoreDbContext" \
  --project "$INFRA_PROJECT" \
  --startup-project "$STARTUP_PROJECT" \
  --verbose

# 2. Then ExtensionsDbContext (client tables)
echo ""
echo "=== Deploying ExtensionsDbContext (extensions schema) ==="
DBCONTEXT="ExtensionsDbContext"
SCHEMA="extensions"
# Run steps 2-6 with ExtensionsDbContext...

dotnet ef database update \
  --context "ExtensionsDbContext" \
  --project "$INFRA_PROJECT" \
  --startup-project "$STARTUP_PROJECT" \
  --verbose
```

**Order matters:** Core MUST be deployed first (Extensions may have foreign keys to Core tables).
