-
Notifications
You must be signed in to change notification settings - Fork 0
tools db migrations
Ondrej Rafaj edited this page Nov 6, 2025
·
1 revision
- Give super user operators a quick audit trail of every Prisma migration applied to production.
- Surface migration timing, duration, and rollback metadata without requiring database console access.
- Provide a one-click way to copy the Makefile rollback command for any migration when triaging issues.
- Navigation entry and page render only when the current membership reports
teamRoleType === "su". - Non-super users attempting to reach the route are redirected back to
/tools.
- Standard admin breadcrumb (
Dashboard → Tools → DB Migrations) followed by an intro card. - Card header contains a short description, a compact search input, and a refresh button.
- Main body renders an MUI table (size
small) listing migrations with status chips, timestamps, duration, and rollback timestamp. - Table rows show the migration name, ID, and checksum in the first column to aid lookups.
- Search box filters client-side across migration name, status label, and ID (case-insensitive).
- Refresh button re-fetches the migrations list from the API while preserving any active filter.
-
Copy revertbutton writesmake rollback <migration_name>to the clipboard and surfaces success/error snackbars. - Status chips map
applied,running,pending,rolledBackto success/info/default/error colours for quick scanning. - Duration column renders an
HH:MM:SS(orMM:SS) timestamp derived fromstartedAt/finishedAtwhen both are present.
-
dbBrowserService.listMigrations→GET /tools/db/migrations(requires super user membership). - Relies on
navigator.clipboard.writeTextfor the copy action andnotistacksnackbars for feedback. - Date/time formatting uses
Intl.DateTimeFormatso locale preferences carry through automatically.