Skip to content

feat(dashboard): tenant migrations page#1866

Merged
leandrocp merged 10 commits into
mainfrom
lp-dashboard-pg-delta
May 18, 2026
Merged

feat(dashboard): tenant migrations page#1866
leandrocp merged 10 commits into
mainfrom
lp-dashboard-pg-delta

Conversation

@leandrocp
Copy link
Copy Markdown
Contributor

@leandrocp leandrocp commented May 13, 2026

New page to help debug and fix tenants crashing due to bad DB state, usually caused by missing or altered objects. It won't execute any statement automatically but it shows a plan generated by pg-delta and allows to apply the changes in the tenant DB.

Features

  • list all applied migrations
  • output plan to fix bad state using pg-delta
  • show potential risk (calculated by pg-delta)
  • apply changes (fix issues)

Extra

  • added postgres_version in tenant info page (relevant to migrations)

Preview

No drift

no drift

Safe fix (create missing table)

add missing table safe

Risk of data loss

rename data loss

Apply

apply

Comment thread Dockerfile Outdated
@coveralls
Copy link
Copy Markdown

coveralls commented May 13, 2026

Coverage Status

coverage: 91.284% (-0.6%) from 91.9% — lp-dashboard-pg-delta into main

- list all applied migrations
- output plan to fix bad state using pg-delta
@leandrocp leandrocp force-pushed the lp-dashboard-pg-delta branch from 9f74109 to 9f5df10 Compare May 13, 2026 20:53
Comment thread lib/realtime_web/dashboard/tenant_migrations.ex Outdated
Comment thread lib/mix/tasks/realtime.export_tenant_db_baseline.ex
@leandrocp leandrocp force-pushed the lp-dashboard-pg-delta branch from 77828fb to 1ed7921 Compare May 14, 2026 21:53
@leandrocp leandrocp requested a review from edgurgel May 15, 2026 15:47
end)

tenant = tenant_fixture()
tenant = Containers.checkout_tenant(run_migrations: true)
Copy link
Copy Markdown
Contributor Author

@leandrocp leandrocp May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this one because I added a query to fetch pg_version in tenant info page. We have this info in admin studio but it's worth having it at hand on realtime admin.

@leandrocp leandrocp merged commit e321546 into main May 18, 2026
14 checks passed
@leandrocp leandrocp deleted the lp-dashboard-pg-delta branch May 18, 2026 16:47
@realtime-release-bot
Copy link
Copy Markdown

🎉 This PR is included in version 2.96.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants