fix: Connect seed-dev demo operator seeder to identity database#2144
fix: Connect seed-dev demo operator seeder to identity database#2144
Conversation
seedDemoOperator used DATABASE_URL directly, which points to meridian_platform. The identity repository needs meridian_identity where the org_<tenant> schemas contain the identity tables. Derive the identity DSN from DATABASE_URL by replacing the database component, matching how the main binary routes per-service connections via ServiceDatabases.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 52 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Claude Code ReviewCommit: SummaryClean, well-scoped bug fix. The The PR description provides clear evidence (the exact error from demo deploy), and the fix is minimal and targeted. Risk Assessment
Findings
Test CoverageNo test changes in this PR. Bot Review NotesNo unresolved bot review threads found. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
`seedDemoOperator` (added in #2137) used `DATABASE_URL` directly, which points to `meridian_platform`. The identity repository needs `meridian_identity` where the `org_` schemas contain the identity tables. Derive the correct DSN by replacing the database component.
Evidence
Demo deploy on 8d9b639 - manifest applied successfully, then:
```
ERROR tenant scope: schema not provisioned schema=org_volterra_energy
Error: seed demo operator: seed demo users: seeding demo user operator@volterra.energy:
checking for existing demo user: tenant schema not provisioned: schema does not exist in database: org_volterra_energy
```
The `org_volterra_energy` schema exists in `meridian_identity` but not in `meridian_platform` (where `DATABASE_URL` points).
Fix
Add `replaceDatabase(baseDSN, "meridian_identity")` to swap the database component before connecting, matching how the main binary routes per-service connections via `ServiceDatabases`.
Test plan